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 <james.r.harris@intel.com>
Change-Id: Iad2e861cfa0bfd16c853332650e3ab3a9727f490

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9624
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Jim Harris 2021-09-24 03:06:17 -07:00 committed by Tomasz Zawadzki
parent de04fa748f
commit ae51da29da

View File

@ -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 */