seed: carry restart approval policy into new worlds
Make legacy core.exit share core.restart's supervisor gate and pending request. Seed the stable agent prompt and boot comments with the approval and shutdown contract, and check real init output under a deadline. Cover both aliases' gate, response grace, coalescing and exit status. Card: SAU-135
This commit is contained in:
+3
-28
@@ -1014,19 +1014,6 @@ async fn stop_closes_stdin_and_waits_for_exit() {
|
||||
h.stop().await;
|
||||
}
|
||||
|
||||
/// PROTOCOL 9: core exit requests restart from its handler.
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||
async fn core_exit_requests_restart_from_its_handler() {
|
||||
let w = TestWorld::new();
|
||||
let h = w.start().await;
|
||||
assert_eq!(call(&h, "core.exit", json!({})).await, json!({}));
|
||||
tokio::time::timeout(std::time::Duration::from_secs(1), h.exit_requested())
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
h.stop().await;
|
||||
}
|
||||
|
||||
/// PROTOCOL 3.3: process ids are uuidv7 and versions are sha256.
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||
async fn process_ids_are_uuidv7_and_versions_are_sha256() {
|
||||
@@ -1288,19 +1275,6 @@ async fn journal_has_wal_and_identity_indexes() {
|
||||
h.stop().await;
|
||||
}
|
||||
|
||||
/// PROTOCOL 9: core exit works through core call.
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||
async fn core_exit_works_through_core_call() {
|
||||
let w = TestWorld::new();
|
||||
let h = w.start().await;
|
||||
assert_eq!(
|
||||
call(&h, "core.call", json!({"method":"core.exit","params":{}})).await,
|
||||
json!({})
|
||||
);
|
||||
assert!(h.restart_requested());
|
||||
h.stop().await;
|
||||
}
|
||||
|
||||
/// PROTOCOL 6: acquisitions from different processes keep their FIFO positions.
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||
async fn lock_acquisitions_from_different_processes_are_fifo() {
|
||||
@@ -1989,9 +1963,9 @@ async fn core_restart_cleanly_stops_detached_caller() {
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
/// PROTOCOL 9: core.exit from boot ends the host executable with status 75.
|
||||
/// PROTOCOL 9: supervised core.exit from boot uses the restart shutdown path and code 75.
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||
async fn core_exit_sets_executable_status_75() {
|
||||
async fn core_exit_alias_sets_executable_status_75() {
|
||||
let w = TestWorld::new();
|
||||
std::fs::write(
|
||||
w.0.join("config/boot.yaml"),
|
||||
@@ -2006,6 +1980,7 @@ async fn core_exit_sets_executable_status_75() {
|
||||
.arg(concat!(env!("CARGO_TARGET_TMPDIR"), "/cache"))
|
||||
.arg("run")
|
||||
.arg(&w.0)
|
||||
.env("SAUSAGE_LOOP", "1")
|
||||
.stdin(std::process::Stdio::null())
|
||||
.kill_on_drop(true)
|
||||
.output(),
|
||||
|
||||
Reference in New Issue
Block a user