Skip to content

test: compare the written asciicast with the exported one apart from the clock - #556

Merged
vyncint merged 1 commit into
mainfrom
test/asciicast-export-compare-ignores-the-clock
Oct 4, 2026
Merged

vyncint merged 1 commit into
mainfrom
test/asciicast-export-compare-ignores-the-clock

Conversation

@vyncint

@vyncint vyncint commented Oct 4, 2026

Copy link
Copy Markdown
Owner

the_asciicast_is_a_v2_header_and_one_full_repaint_per_frame exported the
recording twice, once to a string and once through write_asciicast, and
asserted the two were byte-equal. The header's timestamp is the wall
clock at export, on purpose, and another test pins that, so a second
boundary falling between the two exports made the test fail with two
strings identical except for a value one second apart. The features job on
PR 552 saw it once.

Both exports now go through a small helper that removes the header's
timestamp before they are compared, and a guard asserts the helper removed
something so the comparison cannot go vacuous. No sleep is added: the
suite allows two, and the fix needs none.

Checked three ways, each undone afterwards. The old assertion with a
1.1 s pause between the exports fails with CI's exact message. The new one
passes under the same pause. The new one still fails when
write_asciicast writes something else (a renamed header key). The file
passes with default, decode, serde and all features, and twelve repeats.

Closes #555

…the clock

`the_asciicast_is_a_v2_header_and_one_full_repaint_per_frame` exported the
recording twice, once to a string and once through write_asciicast, and
asserted the two were byte-equal. The header's `timestamp` is the wall
clock at export, on purpose, and another test pins that, so a second
boundary falling between the two exports made the test fail with two
strings identical except for a value one second apart. The features job on
PR 552 saw it once.

Both exports now go through a small helper that removes the header's
timestamp before they are compared, and a guard asserts the helper removed
something so the comparison cannot go vacuous. No sleep is added: the
suite allows two, and the fix needs none.

Checked three ways, each undone afterwards. The old assertion with a
1.1 s pause between the exports fails with CI's exact message. The new one
passes under the same pause. The new one still fails when
write_asciicast writes something else (a renamed header key). The file
passes with default, decode, serde and all features, and twelve repeats.

Closes #555

Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com>
@vyncint
vyncint merged commit f8ddee5 into main Oct 4, 2026
16 checks passed
@vyncint
vyncint deleted the test/asciicast-export-compare-ignores-the-clock branch October 4, 2026 06:08
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.

test: the asciicast export test compares two exports taken at different seconds

1 participant