Repository navigation
test: make background flush recovery test deterministic - #355
Merged
Merged
Conversation
Contributor
posthog-dotnet Compliance ReportDate: 2026-10-23T17:28:27.977888+00:00 ✅ All Tests Passed!47/47 tests passed Capture Tests✅ 30/30 tests passed View Details
Feature_Flags Tests✅ 17/17 tests passed View Details
|
ioannisj
approved these changes
Oct 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
💡 Motivation and Context
The release job failed because
BackgroundFlushContinuesAfterExceptionwaited only one second for its second background flush. The same commit passed in the regular CI workflow.The test now uses explicit task signals instead of timed waits. It holds the first flush until the next batch is queued, then lets that flush throw and checks that the next batch is delivered. It also watches the background tasks so a worker that exits after the exception fails an assertion instead of leaving the test waiting forever. Production code is unchanged.
💚 How did you test it?
dotnet restore --locked-mode,bin/fmt --check, and the Release build passed after syncing withmain.dotnet test --configuration Release --no-build --nologo -- RunConfiguration.TargetPlatform=ARM64: 2,883 passed and four existing skips. Both test targets rolled forward to the installed .NET 9 runtime on this Mac.📝 Checklist
If releasing new changes
pnpm changesetto generate a changeset fileThis is a test-only change. No changeset or documentation update is needed.
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Pi used shell, file editing, GitHub CLI, and autoreview tools to investigate the failure and update the test in a dedicated worktree. Explicit synchronization was chosen instead of increasing the timeout. The regression check confirmed that the test still detects a worker stopping after a flush exception. Human review is required.