File tree Expand file tree Collapse file tree
crates/tako/src/internal/tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -377,6 +377,33 @@ fn test_query_min_utilization2() {
377377 }
378378}
379379
380+ #[ test]
381+ fn test_query_min_utilization3 ( ) {
382+ let mut core = Core :: default ( ) ;
383+
384+ let t1 = TaskBuilder :: new ( 1 ) . cpus_compact ( 2 ) . build ( ) ;
385+ let t2 = TaskBuilder :: new ( 2 ) . cpus_compact ( 2 ) . build ( ) ;
386+ submit_test_tasks ( & mut core, vec ! [ t1, t2] ) ;
387+
388+ let descriptor = ResourceDescriptor :: new ( vec ! [ ResourceDescriptorItem {
389+ name: "cpus" . into( ) ,
390+ kind: ResourceDescriptorKind :: simple_indices( 4 ) ,
391+ } ] ) ;
392+ let r = compute_new_worker_query (
393+ & mut core,
394+ & [ WorkerTypeQuery {
395+ descriptor,
396+ time_limit : None ,
397+ max_sn_workers : 2 ,
398+ max_workers_per_allocation : 1 ,
399+ min_utilization : 1.0 ,
400+ } ] ,
401+ false ,
402+ ) ;
403+ assert_eq ! ( r. single_node_workers_per_query, vec![ 1 ] ) ;
404+ assert ! ( r. multi_node_allocations. is_empty( ) ) ;
405+ }
406+
380407#[ test]
381408fn test_query_min_time2 ( ) {
382409 let mut core = Core :: default ( ) ;
You can’t perform that action at this time.
0 commit comments