@@ -512,7 +512,7 @@ namespace tut {
512512 set_test_name (" If multiple matching processes exist,"
513513 " with generation 3 processes at full utilization,"
514514 " generation 2 and generation 1 processes not at full utilization,"
515- " then asyncGet() routes to generation 2 " );
515+ " then asyncGet() routes to generation 1 because it is least busy " );
516516
517517 skDebugSupport.dummyConcurrency = 2 ;
518518
@@ -560,39 +560,39 @@ namespace tut {
560560
561561 // Check various sessions belong to the expected processes.
562562 ensure_equals (" (4)" , sessions[0 ]->getProcess ()->getPid (), process3->getPid ());
563- ensure_equals (" (5)" , sessions[1 ]->getProcess ()->getPid (), process3 ->getPid ());
564- ensure_equals (" (6)" , sessions[2 ]->getProcess ()->getPid (), process2 ->getPid ());
565- ensure_equals (" (7)" , sessions[3 ]->getProcess ()->getPid (), process2 ->getPid ());
566- ensure_equals (" (8)" , sessions[4 ]->getProcess ()->getPid (), process1 ->getPid ());
563+ ensure_equals (" (5)" , sessions[1 ]->getProcess ()->getPid (), process2 ->getPid ());
564+ ensure_equals (" (6)" , sessions[2 ]->getProcess ()->getPid (), process1 ->getPid ());
565+ ensure_equals (" (7)" , sessions[3 ]->getProcess ()->getPid (), process3 ->getPid ());
566+ ensure_equals (" (8)" , sessions[4 ]->getProcess ()->getPid (), process2 ->getPid ());
567567 ensure_equals (" (9)" , sessions[5 ]->getProcess ()->getPid (), process1->getPid ());
568568
569569 // Close a bunch of sessions and we should arrive at the desired situation.
570- sessions[3 ].reset ();
571- sessions[4 ].reset ();
570+ sessions[2 ].reset ();
572571 sessions[5 ].reset ();
572+ sessions[1 ].reset ();
573573 {
574574 LockGuard l (pool->syncher );
575575 ensure_equals (" (10)" , process1->sessions , 0 );
576576 ensure_equals (" (11)" , process2->sessions , 1 );
577577 ensure_equals (" (12)" , process3->sessions , 2 );
578578 }
579579
580- // asyncGet() should select process2 even though process1 has fewer sessions open and is older .
580+ // asyncGet() should select process1 because process1 has fewer sessions open.
581581 pool->asyncGet (options, callback);
582582 prevNumber = number;
583583 EVENTUALLY (5 ,
584584 result = number + 1 ;
585585 );
586586 ProcessPtr process4 = currentSession->getProcess ()->shared_from_this ();
587- ensure_equals (" (13)" , process4->getPid (), process2 ->getPid ());
587+ ensure_equals (" (13)" , process4->getPid (), process1 ->getPid ());
588588 currentSession.reset ();
589589 }
590590
591591 TEST_METHOD (11 ) {
592592 set_test_name (" If multiple matching processes exist, all of them of the same generation,"
593593 " with the lowest-start-time processes being at full utilization"
594594 " and higher-start-time processes not at full utilization,"
595- " then asyncGet() routes to a lowest-start-time process that's not at full utilization" );
595+ " then asyncGet() routes to the process that's at lowest utilization" );
596596
597597 skDebugSupport.dummyConcurrency = 2 ;
598598
@@ -629,16 +629,16 @@ namespace tut {
629629
630630 // Check various sessions belong to the expected processes.
631631 ensure_equals (" (4)" , sessions[0 ]->getProcess ()->getPid (), process1->getPid ());
632- ensure_equals (" (5)" , sessions[1 ]->getProcess ()->getPid (), process1 ->getPid ());
633- ensure_equals (" (6)" , sessions[2 ]->getProcess ()->getPid (), process2 ->getPid ());
634- ensure_equals (" (7)" , sessions[3 ]->getProcess ()->getPid (), process2 ->getPid ());
635- ensure_equals (" (8)" , sessions[4 ]->getProcess ()->getPid (), process3 ->getPid ());
632+ ensure_equals (" (5)" , sessions[1 ]->getProcess ()->getPid (), process2 ->getPid ());
633+ ensure_equals (" (6)" , sessions[2 ]->getProcess ()->getPid (), process3 ->getPid ());
634+ ensure_equals (" (7)" , sessions[3 ]->getProcess ()->getPid (), process1 ->getPid ());
635+ ensure_equals (" (8)" , sessions[4 ]->getProcess ()->getPid (), process2 ->getPid ());
636636 ensure_equals (" (9)" , sessions[5 ]->getProcess ()->getPid (), process3->getPid ());
637637
638638 // Close a bunch of sessions and we should arrive at the desired situation.
639- sessions[3 ].reset ();
640- sessions[4 ].reset ();
639+ sessions[2 ].reset ();
641640 sessions[5 ].reset ();
641+ sessions[1 ].reset ();
642642 {
643643 LockGuard l (pool->syncher );
644644 ensure_equals (" (10)" , process1->sessions , 2 );
@@ -653,7 +653,7 @@ namespace tut {
653653 result = number + 1 ;
654654 );
655655 ProcessPtr process4 = currentSession->getProcess ()->shared_from_this ();
656- ensure_equals (" (13)" , process4->getPid (), process2 ->getPid ());
656+ ensure_equals (" (13)" , process4->getPid (), process3 ->getPid ());
657657 currentSession.reset ();
658658 }
659659
0 commit comments