Skip to content

fix: flaky ProcessHelper test catches leaked exceptions from other tests#454

Merged
PureWeen merged 1 commit intomainfrom
fix/flaky-process-test
Mar 30, 2026
Merged

fix: flaky ProcessHelper test catches leaked exceptions from other tests#454
PureWeen merged 1 commit intomainfrom
fix/flaky-process-test

Conversation

@PureWeen
Copy link
Copy Markdown
Owner

Problem

SafeHasExited_ConcurrentDispose_NoUnobservedTaskException subscribes to TaskScheduler.UnobservedTaskException globally and catches all InvalidOperationExceptions. A leaked unobserved task from StubChatDatabase (DB connection failed) triggers the handler, causing a false test failure.

This caused the v1.0.15 release build to fail: https://github.com/PureWeen/PolyPilot/actions/runs/23745086209/job/69171558724

Fix

Filter the handler to only match process-related InvalidOperationException messages (containing process, exited, or handle) so unrelated test pollution is ignored.

SafeHasExited_ConcurrentDispose_NoUnobservedTaskException subscribed
to TaskScheduler.UnobservedTaskException globally and matched ALL
InvalidOperationExceptions. A leaked task from StubChatDatabase
('DB connection failed') triggered the handler, causing a false
failure.

Fix: filter to only process-related IOE messages (process, exited,
handle) so unrelated test pollution is ignored.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@PureWeen PureWeen merged commit b587ed5 into main Mar 30, 2026
@PureWeen PureWeen deleted the fix/flaky-process-test branch March 30, 2026 13:15
arisng pushed a commit to arisng/PolyPilot that referenced this pull request Apr 4, 2026
…sts (PureWeen#454)

## Problem

`SafeHasExited_ConcurrentDispose_NoUnobservedTaskException` subscribes
to `TaskScheduler.UnobservedTaskException` globally and catches **all**
`InvalidOperationException`s. A leaked unobserved task from
`StubChatDatabase` (`DB connection failed`) triggers the handler,
causing a false test failure.

This caused the v1.0.15 release build to fail:
https://github.com/PureWeen/PolyPilot/actions/runs/23745086209/job/69171558724

## Fix

Filter the handler to only match process-related
`InvalidOperationException` messages (containing `process`, `exited`, or
`handle`) so unrelated test pollution is ignored.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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