pin the declared closure once per rebuild and seed the marker from the running closure
This commit is contained in:
parent
47c2acb640
commit
4356f3840c
1 changed files with 456 additions and 95 deletions
|
|
@ -1560,3 +1560,23 @@ fn a_rebuild_is_live_for_its_own_agent_only() {
|
|||
);
|
||||
assert!(!q.rebuild_live("bob"));
|
||||
}
|
||||
|
||||
/// Agents whose running closure differs from the declaration are rebuilt in one
|
||||
/// sweep. Each rebuild's window holds a build slot, so `buildSlots` caps how
|
||||
/// many swap at once, however many agents the sweep rebuilds.
|
||||
#[test]
|
||||
fn a_sweep_of_rebuilds_holds_one_build_slot_per_agent_window() {
|
||||
let q = JobQueue::new(1);
|
||||
let agents: Vec<String> = ["alice", "bob", "carol"].map(str::to_owned).to_vec();
|
||||
insert(&q, |builder| {
|
||||
crate::workers::auto_update::boot_nodes(builder, &agents, Vec::new());
|
||||
});
|
||||
assert_eq!(
|
||||
declared_resources_of_kind(&q, "agent_window")
|
||||
.iter()
|
||||
.filter(|r| r.contains(&Resource::BuildSlot))
|
||||
.count(),
|
||||
3,
|
||||
"every window declares the build slot"
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue