From 1930cc4fd655fc2890854a56990d032dd0bc5ff2 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Tue, 19 Dec 2023 13:10:08 +0100 Subject: [PATCH] Adjust the regex of spawn-task-external-bad test Now the program fails in runtime directly as the stream is not initialized when Nanos6 attempts to write events. --- test/rt/nanos6/CMakeLists.txt | 2 +- test/rt/nanos6/spawn-task-external-bad.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/test/rt/nanos6/CMakeLists.txt b/test/rt/nanos6/CMakeLists.txt index 5893c52..2411ffb 100644 --- a/test/rt/nanos6/CMakeLists.txt +++ b/test/rt/nanos6/CMakeLists.txt @@ -51,7 +51,7 @@ nanos6_rt_test(taskloop.c) nanos6_rt_test(spawn-task.c) nanos6_rt_test(spawn-task-external.c) nanos6_rt_test(spawn-task-external-bad.c SHOULD_FAIL - REGEX "ovni_finish: thread [0-9]* is not dead") + REGEX "ovni_ev_add: thread is not initialized") # Test multiple instrumentation levels nanos6_rt_test(simple-task.c NAME simple-task-level-1 LEVEL 1) diff --git a/test/rt/nanos6/spawn-task-external-bad.c b/test/rt/nanos6/spawn-task-external-bad.c index 044d340..05a6c9e 100644 --- a/test/rt/nanos6/spawn-task-external-bad.c +++ b/test/rt/nanos6/spawn-task-external-bad.c @@ -52,12 +52,17 @@ complete_func(void *arg) complete = 1; } -/* Call the nanos6_spawn_function from an external thread */ +/* Call the nanos6_spawn_function from an external thread without + * instrumentation. */ static void * spawn(void *arg) { + /* Here Nanos6 will try to write events in the thread stream, + * but the thread has not been initialized so it will abort */ nanos6_spawn_function(polling_func, arg, complete_func, NULL, "polling_task"); + + /* Not reached */ return NULL; }