Repository navigation
test: compare the written asciicast with the exported one apart from the clock - #556
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
the_asciicast_is_a_v2_header_and_one_full_repaint_per_frameexported therecording twice, once to a string and once through write_asciicast, and
asserted the two were byte-equal. The header's
timestampis the wallclock 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