summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2022-11-18 08:56:03 +0100
committerThomas Haller <thaller@redhat.com>2022-11-18 09:41:49 +0100
commit7f218e6ac593b8fb17811dde543324846378fec2 (patch)
treed952d6e60b9dbe2506b680d9ed5b67c3dc21c7ce
parentac359371d7202faa257a6001ceb2f542beab7da1 (diff)
downloadNetworkManager-7f218e6ac593b8fb17811dde543324846378fec2.tar.gz
core/tests: relax timing in "/general/nm_utils_kill_child" test
This test is inherently fragile, as it depends on starting processes, wait for something and kill the process. There are timings involved that are out of control of the test. Try to adjust the timing. # NetworkManager-DEBUG: <debug> [1668755976.9741] kill child process test-s-4 (111487): sending SIGKILL... # NetworkManager-DEBUG: <debug> [1668755976.9753] kill child process test-s-4 (111487): waiting for process to terminate after sending SIGTERM (15) and SIGKILL... # NetworkManager-DEBUG: <debug> [1668755976.9758] kill child process test-s-4 (111487): after sending SIGTERM (15) and SIGKILL, process 111487 exited by signal 9 (5759 usec elapsed) Bail out! GLib:ERROR:../src/core/tests/test-core-with-expect.c:154:test_nm_utils_kill_child_sync_do: Did not see expected message NetworkManager-DEBUG: *<debug> [*] kill child process test-s-4 (*): waiting up to 1 milliseconds for process to terminate normally after sending SIGTERM (15)... Bail out! nm:ERROR:../src/core/tests/test-core-with-expect.c:457:test_nm_utils_kill_child: assertion failed (exit_status == 0): (6 == 0) --- stderr --- ** GLib:ERROR:../src/core/tests/test-core-with-expect.c:154:test_nm_utils_kill_child_sync_do: Did not see expected message NetworkManager-DEBUG: *<debug> [*] kill child process test-s-4 (*): waiting up to 1 milliseconds for process to terminate normally after sending SIGTERM (15)... ** nm:ERROR:../src/core/tests/test-core-with-expect.c:457:test_nm_utils_kill_child: assertion failed (exit_status == 0): (6 == 0) /builds/NetworkManager/NetworkManager/tools/run-nm-test.sh: line 337: 110662 Aborted "${NMTST_DBUS_RUN_SESSION[@]}" "${NMTST_LIBTOOL[@]}" "$NMTST_VALGRIND" --quiet --error-exitcode=$VALGRIND_ERROR --leak-check=full --gen-suppressions=all "${NMTST_SUPPRESSIONS[@]}" --num-callers=100 --log-file="$LOGFILE" "$TEST" "${TEST_ARGV[@]}"
-rw-r--r--src/core/tests/test-core-with-expect.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/tests/test-core-with-expect.c b/src/core/tests/test-core-with-expect.c
index 872b894214..0aba30dd57 100644
--- a/src/core/tests/test-core-with-expect.c
+++ b/src/core/tests/test-core-with-expect.c
@@ -282,7 +282,7 @@ do_test_nm_utils_kill_child(void)
pid4a = test_nm_utils_kill_child_spawn(argv4, TRUE);
/* give processes time to start (and potentially block signals) ... */
- g_usleep(G_USEC_PER_SEC / 10);
+ g_usleep(G_USEC_PER_SEC / 5);
fatal_mask = g_log_set_always_fatal(G_LOG_FATAL_MASK);
@@ -338,12 +338,12 @@ do_test_nm_utils_kill_child(void)
"(No child process*, 10) after sending no signal (0)");
test_nm_utils_kill_child_sync_do("test-s-3-2", pid3s, 0, 0, FALSE, NULL);
- NMTST_EXPECT_NM_DEBUG("kill child process 'test-s-4' (*): waiting up to 1 milliseconds for "
+ NMTST_EXPECT_NM_DEBUG("kill child process 'test-s-4' (*): waiting up to 50 milliseconds for "
"process to terminate normally after sending SIGTERM (15)...");
NMTST_EXPECT_NM_DEBUG("kill child process 'test-s-4' (*): sending SIGKILL...");
NMTST_EXPECT_NM_DEBUG("kill child process 'test-s-4' (*): after sending SIGTERM (15) and "
"SIGKILL, process * exited by signal 9 (* usec elapsed)");
- test_nm_utils_kill_child_sync_do("test-s-4", pid4s, SIGTERM, 1, TRUE, &expected_signal_KILL);
+ test_nm_utils_kill_child_sync_do("test-s-4", pid4s, SIGTERM, 50, TRUE, &expected_signal_KILL);
NMTST_EXPECT_NM_DEBUG("kill child process 'test-a-1-1' (*): wait for process to terminate "
"after sending SIGTERM (15) (send SIGKILL in 3000 milliseconds)...");