Repository navigation
test(ui/di): stop the trend feed before the cleanup - #25
Merged
Merged
Conversation
TheTrendShowsTheStoredPointsAfterARestart failed in about one full run in four with "The process cannot access the file 'spectra.db'" from TempFolder.Dispose. The restarted app reads the stored day in hour chunks in the background; the test returns once its points land, and its cleanup stopped only the store before deleting the folder, while a trend read still held a reader connection that ClearAllPools cannot close. Both container cleanups now await TrendFeed.StopAsync before the store's stop, the order the app's own close follows, so no read holds the file at the delete. Eight full runs passed after the change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
AppLifecycleTrendTests.TheTrendShowsTheStoredPointsAfterARestartfailed in about one full test run in four to six. The test's assertions passed, and the failure came from its cleanup:The restarted app reads the stored day from
spectra.dbin hour chunks in the background. The test returns once its points land. The cleanup stopped only the spectrum store before it deleted the temp folder, while a trend read still held a reader connection.SqliteConnection.ClearAllPoolscannot close a connection that is in use.The app is not affected: its close awaits
TrendFeed.StopAsync, which waits for the reads, before it stops the store.Change
AppLifecycleTestBaseandCompositionRootTestsnow record each container'sTrendFeed. Their cleanup awaitsTrendFeed.StopAsync()before the store's stop, the same order as the app's close.Verification
--blame-hangand no hang. At the old rate there was about a 1-in-6 chance of 8 passes in a row anyway, so this is strong evidence, not proof.CompositionRootTests.TheAppBuildsTheMainWindowFromTheProvideruses the same setup and gets the same cleanup. Its own failure text was never captured, so the shared cause is likely but unconfirmed.dotnet format --verify-no-changesandterseon the changed files: exit 0.Per-task commits before collapse
🤖 Generated with Claude Code