Skip to content

Flaky: test_initialize_output_dict fails intermittently under xdist (order-dependent) #984

Description

@alongd

arc/scheduler_test.py::TestScheduler::test_initialize_output_dict fails intermittently in CI, on main and on PRs that do not touch the scheduler at all.

FAILED arc/scheduler_test.py::TestScheduler::test_initialize_output_dict - AssertionError: False is not true

The assertion is self.assertTrue(self.sched1._does_output_dict_contain_info()) (arc/scheduler_test.py:350).

Evidence that it is order-dependent, not a real defect

Suspected cause

self.sched1 is built in setUpClass, and _does_output_dict_contain_info() reads state that other tests in the class populate. A likely contributor is global mutation of default_job_types: initialize_job_types() aliases and dels the module-level global, so a test that calls it changes what a later Scheduler sees. PR #926 carries a commit "Stop initialize_job_types from mutating the global default_job_types", which may remove the cause; worth re-checking this test's stability once that lands.

Suggested fix

Make the test self-sufficient rather than dependent on sibling tests — populate the output dict it asserts on inside the test (or in setUp), so it passes under -p no:randomly, in isolation, and on any xdist shard.

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