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[@]}"
This commit is contained in:
@@ -282,7 +282,7 @@ do_test_nm_utils_kill_child(void)
|
|||||||
pid4a = test_nm_utils_kill_child_spawn(argv4, TRUE);
|
pid4a = test_nm_utils_kill_child_spawn(argv4, TRUE);
|
||||||
|
|
||||||
/* give processes time to start (and potentially block signals) ... */
|
/* 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);
|
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)");
|
"(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);
|
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)...");
|
"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' (*): sending SIGKILL...");
|
||||||
NMTST_EXPECT_NM_DEBUG("kill child process 'test-s-4' (*): after sending SIGTERM (15) and "
|
NMTST_EXPECT_NM_DEBUG("kill child process 'test-s-4' (*): after sending SIGTERM (15) and "
|
||||||
"SIGKILL, process * exited by signal 9 (* usec elapsed)");
|
"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 "
|
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)...");
|
"after sending SIGTERM (15) (send SIGKILL in 3000 milliseconds)...");
|
||||||
|
Reference in New Issue
Block a user