From ae51da29da3d2d1e36611d6b95df9577d72c4c09 Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Fri, 24 Sep 2021 03:06:17 -0700 Subject: [PATCH] test/reactor_ut: don't assert number of events Refactor this part of the unit tests to make it a bit easier to maintain as the dynamic scheduler itself is modified. For example, depending on the simulated thread loads, we may need to pass extra events to cores for purposes of setting interrupt mode. The important thing to test here isn't how many events it takes to do that, but what is the end result. Signed-off-by: Jim Harris Change-Id: Iad2e861cfa0bfd16c853332650e3ab3a9727f490 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9624 Tested-by: SPDK CI Jenkins Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Reviewed-by: Changpeng Liu Reviewed-by: Tomasz Zawadzki Reviewed-by: Ben Walker --- test/unit/lib/event/reactor.c/reactor_ut.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/unit/lib/event/reactor.c/reactor_ut.c b/test/unit/lib/event/reactor.c/reactor_ut.c index f1107bbde..ff4e61b35 100644 --- a/test/unit/lib/event/reactor.c/reactor_ut.c +++ b/test/unit/lib/event/reactor.c/reactor_ut.c @@ -596,7 +596,7 @@ test_scheduler(void) reactor = spdk_reactor_get(i); CU_ASSERT(reactor != NULL); MOCK_SET(spdk_env_get_current_core, i); - CU_ASSERT(event_queue_run_batch(reactor) == 1); + event_queue_run_batch(reactor); CU_ASSERT(!TAILQ_EMPTY(&reactor->threads)); } @@ -632,7 +632,7 @@ test_scheduler(void) MOCK_SET(spdk_env_get_current_core, 0); _reactors_scheduler_gather_metrics(NULL, NULL); - CU_ASSERT(_run_events_till_completion(3) == 3); + _run_events_till_completion(3); MOCK_SET(spdk_env_get_current_core, 0); /* Threads were idle, so all of them should be placed on core 0. @@ -657,7 +657,7 @@ test_scheduler(void) reactor = spdk_reactor_get(0); CU_ASSERT(reactor != NULL); MOCK_SET(spdk_env_get_current_core, 0); - CU_ASSERT(event_queue_run_batch(reactor) == 2); + event_queue_run_batch(reactor); reactor = spdk_reactor_get(0); CU_ASSERT(reactor != NULL); @@ -698,7 +698,7 @@ test_scheduler(void) MOCK_SET(spdk_env_get_current_core, 0); _reactors_scheduler_gather_metrics(NULL, NULL); - CU_ASSERT(_run_events_till_completion(3) == 3); + _run_events_till_completion(3); MOCK_SET(spdk_env_get_current_core, 0); /* Threads were busy, so they should be distributed evenly across cores */