Skip to content

Commit

Permalink
test stub for proper testing of routing algo
Browse files Browse the repository at this point in the history
  • Loading branch information
CamJN committed Sep 23, 2024
1 parent a376e8e commit 824166d
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions test/cxx/Core/ApplicationPool/PoolTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,35 @@ namespace tut {
ensure_equals(gen1+1,gen2);
}

TEST_METHOD(16) {
// Test that the correct process from the pool is routed
Options options = createOptions();
ensureMinProcesses(2);

// async restart the group
ensure(pool->restartGroupByName(options.appRoot));
ensureMinProcesses(1);

/*
Imagine we have these processes (ordered from oldest to newest):
#. PID 1 (generation A, busyness 5)
#. PID 2 (generation A, busyness 3)
#. PID 3 (generation B, busyness 1)
The algorithm should select PID 3
*/

/*
Imagine we have these processes (ordered from oldest to newest):
#. PID 1 (generation A, busyness 1)
#. PID 2 (generation B, busyness 5)
The algorithm should select PID 1
*/
}

TEST_METHOD(17) {
// Test that restartGroupByName() spawns more processes to ensure
// that minProcesses and other constraints are met.
Expand Down

0 comments on commit 824166d

Please sign in to comment.