Bind cold start to production authorities
This commit is contained in:
parent
a9c9cf7ab3
commit
b2f178d25e
1 changed files with 816 additions and 30 deletions
|
|
@ -1,3 +1,4 @@
|
|||
use std::cell::Cell;
|
||||
use std::fs::OpenOptions;
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
|
|
@ -225,6 +226,36 @@ fn complete_startup(
|
|||
lifecycle.publish_domain().unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bootstrap_owner_guard_failure_uses_exact_modeled_disconnect_transition() {
|
||||
let directory = tempfile::tempdir().unwrap();
|
||||
let store = open_store(&directory);
|
||||
let (domain_adapter, session_adapter) = adapters();
|
||||
let actions = Arc::clone(&domain_adapter.actions);
|
||||
let mut lifecycle = HostCoordinatorLifecycle::new(&store, domain_adapter, session_adapter);
|
||||
let checks = Cell::new(0_u8);
|
||||
let owner = session(10, 1);
|
||||
let published = lifecycle
|
||||
.bootstrap_new_domain_while_owner_live(generation(1), owner.clone(), || {
|
||||
checks.set(checks.get() + 1);
|
||||
checks.get() < 3
|
||||
})
|
||||
.unwrap();
|
||||
assert!(!published);
|
||||
assert_eq!(lifecycle.phase(), DomainPhase::Failed);
|
||||
assert!(!lifecycle.is_published());
|
||||
assert_eq!(
|
||||
lifecycle.session_phase(owner.session_id),
|
||||
Some(SessionPhase::Closed)
|
||||
);
|
||||
assert!(
|
||||
!actions
|
||||
.lock()
|
||||
.unwrap()
|
||||
.contains(&LifecycleAction::PublishDomain)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn exact_start_join_disconnect_and_teardown_actions_are_ordered() {
|
||||
let directory = tempfile::tempdir().unwrap();
|
||||
|
|
|
|||
Loading…
Reference in a new issue