Skip to content

kobo-sim: unchanged_frames_do_not_replay_the_previous_transition flakes under parallel tests #46

Description

@ludoo

unchanged_frames_do_not_replay_the_previous_transition in kobo-sim fails about a third of the time under a plain cargo test, and never under cargo test -- --test-threads=1. It reproduces on main, so it is not caused by any pending branch.

The cause looks to be the system typesetter, which kobo-text installs lazily into a process-global OnceLock. Tests running in parallel share that global, so whether the install lands between the test's two frame() calls decides whether the second frame is judged unchanged. The test is asserting on a process-wide side effect it does not own.

Reproducing it:

cargo test -p kobo-sim            # fails roughly one run in three
cargo test -p kobo-sim -- --test-threads=1   # passes every time

Happy to send a fix if you have a preference for the shape. The obvious ones are having the test install the typesetter itself before the first frame, or giving the simulator an explicit typesetter rather than reading the global.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions