MCPcopy Create free account
hub / github.com/It4innovations/hyperqueue / fill_backlog

Function fill_backlog

crates/hyperqueue/src/server/autoalloc/process.rs:1496–1519  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1494
1495 #[tokio::test]
1496 async fn fill_backlog() {
1497 run_test(async |mut ctx: TestCtx| {
1498 let queue_id = ctx
1499 .add_queue(
1500 always_queued_handler(),
1501 QueueBuilder::default().backlog(4).max_workers_per_alloc(2),
1502 )
1503 .await;
1504
1505 let rq_id = ctx.default_rq_id();
1506 ctx.create_simple_tasks(100, rq_id).await;
1507 ctx.assign_worker_resource(queue_id, WorkerConfigBuilder::default());
1508 ctx.try_submit().await;
1509
1510 let allocations = ctx.get_allocations(queue_id);
1511 assert_eq!(allocations.len(), 4);
1512 assert!(
1513 allocations
1514 .iter()
1515 .all(|alloc| alloc.target_worker_count == 2)
1516 );
1517 })
1518 .await;
1519 }
1520
1521 // When we don't know worker resources, create only a single conservative "probe" allocation
1522 // if there are some tasks waiting for resources

Callers

nothing calls this directly

Calls 10

run_testFunction · 0.85
always_queued_handlerFunction · 0.85
max_workers_per_allocMethod · 0.80
backlogMethod · 0.80
default_rq_idMethod · 0.80
create_simple_tasksMethod · 0.80
try_submitMethod · 0.80
add_queueMethod · 0.45
get_allocationsMethod · 0.45

Tested by

no test coverage detected