Skip to content

Fix flaky tests that are recently popping up #4506

Closed
@NicolasHug

Description

@NicolasHug

Since #4497 was merged, we're observing a few tests that start randomly failing.

Before #4497, these tests were almost always using the same RNG state, which was set in a test that was run earlier in the test execution suite. Now that all tests are properly independent and that the RNG doesn't leak, these tests run with a new RNG at each execution, and if they're unstable they might fail.

(Note: this is a good thing; it's better to know that they fail now rather than when submiting an unrelated PR, which is what happened in #3032 (comment))

For each of these tests we should find out whether the flakyness is severe or not. A simple solution is to parametrize the test over 100 or 1000 random seeds and check the failure rate. If the failure rate is reasonable we can just set a seed with toch.manual_seed(). If not, we should try to fix the test and make it more robust.

The list of tests so far is:

cc @pmeier

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions