Repository navigation
test(apps): recover interrupted lifecycle transitions - #587
Merged
Merged
Conversation
Boot the signed lifecycle fixture from journal entries that interrupted transitions leave behind: an update after it reserved the next generation, an activation with uncertain grants, a removal the authority cannot confirm (cancelled by start), and removals and purges that resume at boot. Refuse a candidate that stays alive with an unsupported protocol after its startup limit, and a release whose declared data the installation never wrote, both without disturbing the running generation. Check that removal and data purge wait while an app owns a proxy host. Refs #453 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 37 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
This was referenced Nov 26, 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.
Summary
This PR adds tests for #453 lifecycle transitions that were not covered so far. Each new manager scenario boots from a journal entry that an interrupted transition leaves behind. The scenarios run inside the existing privileged signed lifecycle,
app_manager::tests::privileged_signed_lifecycle. That test runs as root in the Rust job (rust-coverage.sh) and in App Runtime Reference on AMD64 and ARM64.No production code changes. Every scenario passed against the current manager, so these tests found no recovery bug.
Tests and the #453 criteria they prove
check_interrupted_transitions(core/tests/private/app_manager/lifecycle.rs), interrupted updatecheck_interrupted_transitions, uncertain grantslast-grants-generationadvances to the restarted generation, and the journal clears the uncertainty.check_interrupted_transitions, interrupted removalremovingand needs recovery.startcancels the removal and runs 1.0.0 again.exercise,resumed-removalandresumed-purgeRemoving, with a pending fence) fences, keeps the data and endsremoved. A purge (Purging) erases the data and endspurged.check_interrupted_transitions, never-ready candidate9.9.9. Activation fails withtimed outat the 2 s startup limit. The previous release restarts with the approved grants, and the candidate stays staged. The fixture app consumes afixture-never-readymarker once at startup, so only the candidate misreports.check_interrupted_transitions, incompatible dataactivateis refused with the incompatible-data error, before the fence. A UI rollback to it fails withincompatibleData. The manager status and the running app's PID stay unchanged.removal and data purge wait while the app owns a proxy host(web/src/tests/server/AppRuntime/authority.db.test.ts)removableandpurge-datareturnconflictwhile the installation owns a proxy host, before and after its generation is revoked. Deleting the host releases both.Fixture changes:
lifecycle_packagesadds release 1.1.0-rc.2 with a data declaration. The offered update from 1.0.0 is still 1.1.0.removableas unavailable while a marker file exists next to its socket.Not in this PR
databaseProvisionedneeds PostgreSQL. The PostgreSQL migration and rollback end-to-end checks are handled separately through the published Greeting harness.Testing
cargo fmt --checkand Clippy with--all-targets --all-features -D warnings, on Kiri with Rust 1.99.1.privileged_signed_lifecyclepassed as root in a network-less, read-only container with the CI capability set (41 s). In the same container, all rootapp_manager::tests::andapp_install::tests::passed.authority.db.test.tspassed against PostgreSQL 18.7 with migrations applied. As a mutation check, the new test fails when the owned-host check incheckAppRuntimeDependenciesInTransactionis disabled.Refs #453
🤖 Generated with Claude Code