Skip to content

Improve reproducibility of Lin/STM Thread modes #338

Closed
@jmid

Description

@jmid

The Lin and STM Thread modes do not work as well as the Domain modes.
Failures to trigger an issue (or unexpectedly triggering one for a change) adds noise to our CI results.

Some past history:

As part of the latter, I spent some more time banging my head against the Thread issue.
In the end I used custom runtime_events to record when Threads would spawn to understand what we were observing.
This meant I could get a nice diagram like this:

thread-screenshot (1)
Which confirmed to me that most of our Thread tests indeed had two Threads running concurrently (starting and ending roughly at the same time)

I then went one step further and added custom events for run of one cmd (a small and fast function). This is the result:

run_cmd_screenshot
The little arrows mark simultaneous call and return of run. There are two next to each other, because Thread.yield triggers right after one (on Thread 0) and then the next happens (on Thread 1). This tells me that the Threads are also interleaving - it just happens too deterministically - in between each run - but very very very rarely in the middle of it.

The above may be helpful to guide further improvement attempts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    test suite reliabilityIssue concerns tests that should behave more predictably

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions