Skip to content

Various testCancel's : Replace with simpler test that is more reliable - #1575

Open
danieldresser-ie wants to merge 1 commit into
ImageEngine:RB-10.7from
danieldresser-ie:simpleTestCancel
Open

danieldresser-ie wants to merge 1 commit into
ImageEngine:RB-10.7from
danieldresser-ie:simpleTestCancel

Conversation

@danieldresser-ie

@danieldresser-ie danieldresser-ie commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

The previous testCancel implementation used a second Python thread and a timer to send a cancellation that should arrive when once the target function was actually in the meat of the compute. This wasn't very reliable though - we were only testing cancellation at one point in time, and depending on how long the Python thread took to actually start, we might be testing cancellation at the very beginning of the target function. This test was also quite unreliable ( for reasons I honestly don't fully understand ) - we'd already disabled it when inMacCI(), but we were also seeing occasional failures in our Linux CI ( and quite frequently in ImageEngine's CI ).

John suggested that it would make sense to replace this with a simpler test that just makes sure cancellation is checked somewhere in the target function. This does not give us particularly good coverage ( if there is a Canceller::check() at the beginning, then this test will always pass, even if Canceller::check() is missing inside heavy loops where it's really needed ), but the coverage wasn't great anyway, and this test is much simpler and more reliable.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant