Skip to content

Commit

Permalink
add unit test for dynamic client ramp up
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Oviedo <[email protected]>
  • Loading branch information
OVI3D0 committed Feb 17, 2025
1 parent f50ece2 commit fd378e1
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/worker_coordinator/worker_coordinator_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,24 @@ def test_client_reaches_join_point_which_completes_parent(self):
self.assertEqual(1, target.on_task_finished.call_count)
self.assertEqual(4, target.drive_at.call_count)

@run_async
async def test_load_test_clients_override(self):
self.cfg.add(config.Scope.applicationOverride, "workload", "load.test.clients", 100)

task = self.workload.find_test_procedure_or_default("default").schedule[0]
original_clients = task.clients

d = worker_coordinator.WorkerCoordinator(self.create_test_worker_coordinator_target(), self.cfg,
os_client_factory_class=WorkerCoordinatorTests.StaticClientFactory)

d.prepare_benchmark(t=self.workload)
d.start_benchmark()

# verify the task is modified with the load test client count
self.assertEqual(original_clients, 4)
self.assertEqual(task.clients, 100)
self.assertEqual(task.params["target-throughput"], 100)


def op(name, operation_type):
return workload.Operation(name, operation_type, param_source="worker-coordinator-test-param-source")
Expand Down

0 comments on commit fd378e1

Please sign in to comment.