fix(runtime): epic train follow-ups#195
Open
mfw78 wants to merge 1 commit into
Open
Conversation
… semantics Close the runtime-verification gaps left open across the M0 launch train: - Drive ComponentsBuilder::build end-to-end so the backend assembly, data directory creation, and log pipeline sizing run at launch, not just typecheck. - Exercise the preset shortcut and the AssembledRuntime launch path at runtime, asserting a bad config bails and add-ons install once before boot. - Lock RuntimeHandle semantics: clean completion resolves Ok, the shutdown trigger drives wait to return, and an abnormal task stop surfaces the error. - Assert an invalid metrics bind address surfaces the wrapped error at install. Also summarise drained reconnect-task exit reasons at debug for soak diagnosis, and note that LaunchContext.data_dir is advisory for the pre-built launcher.
fdd03a5 to
f7c4c52
Compare
bae8eab to
077f605
Compare
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 is a test-only follow-up to the epic train, adding coverage the prior PRs in the stack left as gaps: builder assembly, add-on install ordering, and runtime handle shutdown/wait semantics.
Closes #79.
This is part of the epic #79 train and merges in stack order, so it should land after its base,
feat/m0-runtime-preset, and before any further train PRs.Changes
crates/nexum-runtime/src/runtime/task.rs:TaskSet::shutdownnow tallies each handle's join outcome (clean versus aborted) into adebug!summary while keeping the existing abort-then-join drain unchanged.crates/nexum-runtime/src/builder.rs: a terse rustdoc note markingLaunchContext.data_diras advisory and unused by the pre-built launcher.crates/nexum-runtime/src/addons.rs,crates/nexum-runtime/src/builder.rs,crates/nexum-runtime/src/host/component/builder.rs,crates/nexum-runtime/src/runtime/task.rs: eight new tests coveringComponentsBuilder::buildopening the core backends, add-on install running exactly once before boot, an invalidbind_addrrejection on the Prometheus add-on, the runtime handle's clean-completion and aborted-terminationwait()outcomes, the handle's shutdown-trigger-to-wait path, a mixed clean-and-pending drain ofTaskSet::shutdown, and a smoke test locking the preset launch path throughRuntimeBuilder::new(...).runtime::<CoreRuntime>().launch().Test plan
cargo fmt --all --checkcargo clippy --workspace --all-targets --all-features -- -D warningscargo test --workspace --all-features --no-fail-fast(all in-tree module wasms built first; thecow_bootand runtime supervisor end-to-end tests ran against the real wasms, not skipped)Notes for reviewer
Several items collected against this train remain deliberately deferred, each with no consumer in this diff, so they are follow-ups rather than gaps in this PR: abstracting
TaskHandle/TaskExitoff tokio and giving the event loop its own completion label instead of reusingTaskExit::ReceiverGone; threading the executor from the CLI or launch root; a typedBuildErrorenum forComponentBuilder::build; renamingRuntimeAddOnsto the singularRuntimeAddOn; migratingexamples/embed.rsonto the type-state builder onceRuntimeHandlecan hand back the log read-handle; and aRuntime::extensions()linker-hook provider, which blocks on aReferenceRuntimepreset landing inshepherd-cow-host.The add-on install-ordering test uses a stub add-on for the count and ordering assertion, and drives the invalid-
bind_addrpath directly against the realPrometheusAddOn, because that add-on installs a process-global metrics recorder that can be set only once per test binary; the invalid-address path errors at parse time before touching the recorder, so exercising it directly is safe.The aborted-termination
wait()test uses a deliberately aborted task rather than a panicking one as the fault proxy, since both yield the sameJoinErroroutcome and panicking a spawned task risks tripping nextest's spawned-panic failure mode.The
bootstrap::runshim has no in-tree callers today (the CLI usesRuntimeBuilderdirectly and the embed example uses the preset); it is left in place as a public surface for the epic to reconcile rather than removed in this follow-up.AI Assistance: Claude Code (Opus 4.8 implementation and adversarial review, Sonnet 5 PR authoring) used for the full change.