Close hostile recovery and concurrency gaps
This commit is contained in:
parent
696dae610a
commit
3f9b1b3543
1 changed files with 306 additions and 113 deletions
|
|
@ -177,12 +177,27 @@ fn nonzero_guest_exit_is_the_cli_status() {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn stale_and_lost_coordinators_are_actionable_failures() {
|
||||
let mut stale = FakeBackend {
|
||||
fn stale_domain_enters_lock_arbitration_while_live_stale_and_lost_faces_refuse() {
|
||||
let mut unowned = FakeBackend {
|
||||
observations: [DomainStatus::Stale].into(),
|
||||
acquisition: Some(BootstrapAcquisition::Leader),
|
||||
bootstrap: Some(Ok(Endpoint::Published)),
|
||||
..FakeBackend::default()
|
||||
};
|
||||
assert!(invoke(&mut stale).unwrap_err().contains("stale"));
|
||||
assert_eq!(invoke(&mut unowned).unwrap().0, 0);
|
||||
assert_eq!(
|
||||
unowned.actions,
|
||||
["validate", "observe", "acquire", "bootstrap", "execute"]
|
||||
);
|
||||
|
||||
let mut live = FakeBackend {
|
||||
observations: [DomainStatus::Stale].into(),
|
||||
acquisition: Some(BootstrapAcquisition::Waiter),
|
||||
waited: Some(Err(ClientError::StaleCoordinator)),
|
||||
..FakeBackend::default()
|
||||
};
|
||||
assert!(invoke(&mut live).unwrap_err().contains("stale"));
|
||||
assert_eq!(live.actions, ["validate", "observe", "acquire", "wait"]);
|
||||
|
||||
let mut lost = FakeBackend {
|
||||
observations: [DomainStatus::Ready(Endpoint::Existing)].into(),
|
||||
|
|
|
|||
Loading…
Reference in a new issue