Skip to content

conformance: fixed timestamps in the table golden tests (flaky byte comparison) - #216

Merged
securedeveloper merged 1 commit into
mainfrom
rde-golden-flake
Nov 17, 2026
Merged

securedeveloper merged 1 commit into
mainfrom
rde-golden-flake

Conversation

@securedeveloper

Copy link
Copy Markdown
Owner

The table golden tests in test/conformance/golden.test.tsx (from #213) compare react-data-export's file with javascript-excel's byte for byte. They didn't set document properties, so docProps/core.xml carried the time of each write. The two files then differed whenever the two writes fell in different seconds. This is now a required check, and it failed on #215: <ExportTableButton> is byte-identical on Node 24 / React 19 and Node 26 / React 17.

Fix: both sides are written with fixed created/modified dates (properties for exportTable, useTableExport and <ExportTableButton>; properties in the toUint8Array reference). The corpus and builder tests already use fixed dates.

Cause checked locally: two toUint8Array writes of the same workbook 1.1 s apart differ without properties and are identical with fixed ones. After the fix, the golden file passes 5 runs out of 5, and npm test and npm run typecheck pass.

Tests only; no changeset.

Without document properties, docProps/core.xml holds the time of each
write, so the byte comparison of the table golden files failed whenever
the two writes fell in different seconds (seen on #215: Node 24 / React 19
and Node 26 / React 17). Write both sides with fixed created/modified dates,
as the corpus files already are.
@securedeveloper
securedeveloper merged commit ec9a31e into main Nov 17, 2026
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant