fix(E1-12): make shared graph-test teardown deterministic - #49
Open
davidru85 wants to merge 14 commits into
Open
fix(E1-12): make shared graph-test teardown deterministic#49davidru85 wants to merge 14 commits into
davidru85 wants to merge 14 commits into
Conversation
davidru85
had a problem deploying
to
cloud-runtime-verification
September 2, 2026 11:31 — with
GitHub Actions
Error
davidru85
deployed
to
cloud-runtime-verification
September 2, 2026 11:32 — with
GitHub Actions
Active
davidru85
deployed
to
cloud-runtime-verification
September 2, 2026 11:54 — with
GitHub Actions
Active
davidru85
deployed
to
cloud-runtime-verification
September 2, 2026 15:07 — with
GitHub Actions
Active
davidru85
deployed
to
cloud-runtime-verification
September 2, 2026 18:24 — with
GitHub Actions
Active
davidru85
deployed
to
cloud-runtime-verification
September 2, 2026 18:44 — with
GitHub Actions
Active
davidru85
deployed
to
cloud-runtime-verification
September 2, 2026 19:58 — with
GitHub Actions
Active
davidru85
force-pushed
the
story/E1-12-shared-test-graph-close-race
branch
from
September 2, 2026 20:00
0ca4c62 to
6776810
Compare
davidru85
deployed
to
cloud-runtime-verification
September 2, 2026 20:01 — with
GitHub Actions
Active
davidru85
force-pushed
the
story/E1-12-shared-test-graph-close-race
branch
from
September 2, 2026 20:19
6776810 to
4877daf
Compare
davidru85
had a problem deploying
to
cloud-runtime-verification
September 2, 2026 20:19 — with
GitHub Actions
Error
davidru85
force-pushed
the
story/E1-12-shared-test-graph-close-race
branch
from
September 2, 2026 20:20
4877daf to
e4c641e
Compare
davidru85
deployed
to
cloud-runtime-verification
September 2, 2026 20:21 — with
GitHub Actions
Active
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.
Summary
AppGraphTestHarness, migrate every Kotlin caller-owned graph holder scope in:sharedtests, and remove directbackgroundScope.launchcollectors.AppGraphand update project continuity records.Jobwhen harness construction fails, make all harness-test teardown exception-safe, remove obsolete imports, and refresh the continuity record with final report-derived counts.Story
E1-12 - FuelEntryStateHolderTest Kotlin/Native SIGSEGV on Graph Close - SAddresses #42.
Ready Check
ProposedorPendingIn-Progress Checkpoint
story/E1-12-shared-test-graph-close-race, based onmainat64c91d6e4c641e, last code-bearing commit4d86f82(REDed698e0, GREEN55f075c, REFACTORa7fb619, continuity checkpointsb23b4d2/a4009df, review fixes27030d6/fa69083/eb8755f, second review round RED5b9cb46, GREEN92bc607, REFACTOR4d86f82, documentation9258821, CI-evidence checkpointsf62516d,6776810ande4c641e)e4c641ein run33678743365with no reruns; this pull request is open and MUST NOT be merged by the agentJobwhen harness construction fails (scheduler validated beforescopeJobcreation, RED-confirmed); made every harness-test teardown exception-safe with nestedtry/finally; removed the obsoleteDatabaseFactory/DatabaseHandleimports fromAppGraphCloseTest.kt; refreshed the handoff continuity record,Files Changedlist and final test counts; appended a correction entry todocs/PROJECT_LOG.md:shared:testAndroidHostTestand:shared:iosSimulatorArm64Test; complete non-instrumented command passed with 627 actionable tasks;contractCheckreports no unresolved decisions and noPENDINGassertions;git diff --checkclean; source audit finds no directbackgroundScope.launchstate-holder collector undershared/src/commonTestScope Completed
close()cancels and joins its scope before closing the graph.UnconfinedTestDispatcher).FuelEntryStateHolderTest,AppGraphContractTest,VehicleFormStateHolderTest, andVehicleListStateHolderTest.AppGraph.scopeJobcreation, so a failed construction leaves no orphaned childJob; all harness-test teardown is exception-safe.Acceptance Evidence
AppGraphTestHarnessTest.closeCancelsCollectorsBeforeClosingTheGraphdeterministically observescollectors-cancelledbeforegraph-closedon Android host and Kotlin/Native.constructorThrowsWhenParentScopeHasNoTestCoroutineSchedulerretains the parentJobexplicitly and asserts that a failed construction leaves no children attached; the assertion was RED against the previous implementation ([SupervisorJobImpl{Active}]observed) and its teardown cancels the parentJobeven if an assertion fails.collectorsRunEagerlyOnUnconfinedTestDispatcherproves emissions are observed eagerly.backgroundScope.launchand no state-holder factory call receivingbackgroundScoperemains undershared/src/commonTest.docs/handoff-E1-12.md.Out of Scope / Not Done
AppGraph.close(), state-holder production lifecycle changes andDatabaseFactorychanges remain explicitly deferred. Pursuing that question requires a separate story because it changes D-89 and touches gatedcore/database/**.Files Changed
AGENTS.mdREADME.mddocs/BACKLOG.mddocs/PROJECT_LOG.mddocs/handoff-E1-12.mdshared/src/commonTest/kotlin/com/ruizurraca/carapp/AppGraphCloseTest.ktshared/src/commonTest/kotlin/com/ruizurraca/carapp/AppGraphContractTest.ktshared/src/commonTest/kotlin/com/ruizurraca/carapp/AppGraphTestHarness.ktshared/src/commonTest/kotlin/com/ruizurraca/carapp/AppGraphTestHarnessTest.ktshared/src/commonTest/kotlin/com/ruizurraca/carapp/FuelEntryStateHolderTest.ktshared/src/commonTest/kotlin/com/ruizurraca/carapp/RecordingDatabaseFactory.ktshared/src/commonTest/kotlin/com/ruizurraca/carapp/VehicleFormStateHolderTest.ktshared/src/commonTest/kotlin/com/ruizurraca/carapp/VehicleListStateHolderTest.ktDecisions Made
NETWORKphase label was interpreted asRED, because this test-only story has no network behavior and the requested sequence otherwise matches the repository TDD workflow.Verification Run
Sharedframework from:composition:ios)Commands or checks run (second review round, final):
Historical first-round evidence (retained for the TDD record; superseded by the final counts above):
Review Findings Resolution
First round:
collect()now launches throughUnconfinedTestDispatcherresolved from the parent scope'sTestCoroutineScheduler, preservingscopeJobparentage;collectorsRunEagerlyOnUnconfinedTestDispatcherproves eager execution.RecordingDatabaseFactory.kt; hardened first-round teardown; added the constructor and eager-dispatcher unit tests.Second round (current):
Job): extendedconstructorThrowsWhenParentScopeHasNoTestCoroutineSchedulerto retain the parentJoband assert no children remain; RED confirmed against the old implementation; fixed by validating the scheduler before creatingscopeJob. Valid harness behavior unchanged: collectors remain children ofscopeJob, run eagerly throughUnconfinedTestDispatcher, and are cancelled and joined beforegraph.close().try/finallyblocks in every harness test soowningFactory.close()still runs whenharness.close()orgraph.close()throws; obsoleteDatabaseFactory/DatabaseHandleimports removed fromAppGraphCloseTest.kt.Files Changed(now includingAppGraphCloseTest.ktandRecordingDatabaseFactory.kt, matchinggit diff --name-status main...HEAD), report-derived final counts and historical/final evidence separation refreshed; append-only correction entry added todocs/PROJECT_LOG.md.Contract Impact
Decision Board Impact
Shared-Write Modules Touched
Project Log Entry
docs/PROJECT_LOG.md(story entry plus append-only correction entry)CI Evidence
e4c641e: runhttps://github.com/davidru85/carApp/actions/runs/33678743365passed all ten required jobs:ktlint(45s),detekt(38s),architecture-check(37s),contract-check(1m41s),android-assemble(44s),android-instrumented-tests(2m34s),shared-tests(3m22s),ios-simulator-build(12m12s),objc-header-golden-check(2m29s),provider-decoupling(2m25s). No reruns needed on this run.9258821in run33667021311andf62516din run33669085132(attempt 4, after three macOS runner flakes: twoAndroidxDriverConnectionPool.close()crashes inViewModelLifecycleTests— the E1-11-documented signature — and one XCUITest swipe-gesture flake; all on commits that touch no code the iOS host tests link).AppGraph.close()connection-pool signature remains the explicitly deferred production-hardening follow-up.Human Review Gate
Gates are defined canonically in
AGENTS.md.AGENTS.mdrepository-state update)The agent does not merge this pull request.
Risks or Follow-ups