Skip to content

Race condition in tests/test_properties.py #139

@rwb27

Description

@rwb27

Describe the bug
In tests/test_properties.py, there is a method toggle_boolprop_from_thread that modifies a property in a background thread. The test has a potential race condition, in that there's no guarantee the thread will have finished before the property is checked to see if it changed.

To Reproduce
This shows up in pytest but only very occasionally.

Expected behaviour
The test should complete reliably, every time.

Resolution
Check the action, and the background thread it starts, have completed before checking the property. This probably requires a thread.join() in the toggle_boolprop_from_thread method, and a poll_task in the test code.

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