Skip to content

fix(Foundation): TaskManagerTest::testCancel waits for the progress notification - #5607

Merged
aleks-f merged 2 commits into
mainfrom
taskmanagertest-cancel-race
Oct 29, 2026
Merged

aleks-f merged 2 commits into
mainfrom
taskmanagertest-cancel-race

Conversation

@aleks-f

@aleks-f aleks-f commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

TaskManagerTest::testCancel fails intermittently on to.progress() == 0.5 (TaskManagerTest.cpp:353), for example in linux-gcc-cmake-poco-soo-off on #5601 and in linux-gcc-cmake-sanitizers (hidden-asan) on #5517. The test waits until the task reports progress 0.5 and then checks the observer. Task::setProgress() stores the progress before it posts the TaskProgressNotification, so the check can run before the observer has received it.

  • Foundation/testsuite: testCancel waits for the observer to receive the progress notification, as testFinish already does.
  • cppignore.win: testCancel is no longer ignored on Windows.

Tests: TaskManagerTest::testCancel passed 100 runs in a row, and TaskManagerTest passed, on Windows ARM64 with MSVC. CI runs it on Windows without the ignore entry.

…otification

Task::setProgress() stores the progress before the TaskProgressNotification
reaches the observer, so the test could check the progress of the observer
before the notification arrived. Wait for the observer, as testFinish does.
@aleks-f aleks-f added this to the Release 2.0 milestone Oct 29, 2026
@aleks-f aleks-f added bug CI Continuous Integration labels Oct 29, 2026
With the race in the test fixed, cppignore.win no longer needs the entry.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the cancellation-test synchronization change and its re-enablement on Windows.

No open issues 🎉

What changed in this PR

Fixes an intermittent failure in Foundation’s task-cancellation test by waiting for the observer to receive progress, rather than only for the task’s internal progress to change.

Changes:

  • Updates testCancel to wait for observed progress before asserting its value, matching testFinish.
  • Re-enables testCancel on Windows by removing its ignore entry.
File Description
Foundation/​testsuite/​src/​TaskManagerTest.cpp Waits for observer progress to avoid the notification race.
cppignore.win Removes the Windows exclusion for testCancel.

Review effort: Balanced

@aleks-f
aleks-f merged commit b052203 into main Oct 29, 2026
60 checks passed
@aleks-f
aleks-f deleted the taskmanagertest-cancel-race branch October 29, 2026 04:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug CI Continuous Integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants