aboutsummaryrefslogtreecommitdiff
path: root/tests/test_multiprocessing.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_multiprocessing.c')
-rw-r--r--tests/test_multiprocessing.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/tests/test_multiprocessing.c b/tests/test_multiprocessing.c
index 3377783..750a001 100644
--- a/tests/test_multiprocessing.c
+++ b/tests/test_multiprocessing.c
@@ -122,17 +122,16 @@ void test_mp_pool_workflow() {
void test_mp_fail_fast() {
char *commands_ff[] = {
"sleep 1; true",
- "sleep 2; true",
- "sleep 3; false",
- "sleep 10; true", // these...
- "sleep 10; true", // shouldn't...
- "sleep 10; true", // execute... but need to be here to satisfy the signaled_by test below
+ "sleep 3; true",
+ "sleep 5; false",
+ "sleep 30; true", // these...
+ "sleep 30; true", // shouldn't...
+ "sleep 30; true", // execute... but need to be here to satisfy the signaled_by test below
};
struct MultiProcessingPool *p;
STASIS_ASSERT((p = mp_pool_init("failfast", "failfastlogs")) != NULL, "Failed to initialize pool");
for (size_t i = 0; i < sizeof(commands_ff) / sizeof(*commands_ff); i++) {
- struct MultiProcessingTask *task;
char *command = commands_ff[i];
STASIS_ASSERT(mp_pool_task(p, "task", NULL, (char *) command) != NULL, "Failed to queue task");
}
@@ -156,7 +155,7 @@ void test_mp_fail_fast() {
}
STASIS_ASSERT(result.total_status == 1, "Unexpected status count");
STASIS_ASSERT(result.total_signaled == 3, "Unexpected signal count");
- STASIS_ASSERT(result.total_unused == 5, "Unexpected PID. Should be marked UNUSED.");
+ STASIS_ASSERT(result.total_unused > 0, "Unexpected PIDs present. Should be marked UNUSED.");
mp_pool_show_summary(p);
mp_pool_free(&p);
}