mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-11 03:52:39 -04:00
selftests: coredump: Fix test failure for slow machines
The test waits for coredump to finish by busy-waiting for the stack_values
file to be created. The maximum wait time is 10 seconds.
This doesn't work for slow machine (qemu-system-riscv64), because coredump
takes longer.
Fix it by waiting for the crashing child process to finish first.
Fixes: 15858da535 ("selftests: coredump: Add stackdump test")
Signed-off-by: Nam Cao <namcao@linutronix.de>
Link: https://lore.kernel.org/ee657f3fc8e19657cf7aaa366552d6347728f371.1744383419.git.namcao@linutronix.de
Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
committed by
Christian Brauner
parent
e194d2067c
commit
6f5bf9f37f
@@ -96,7 +96,7 @@ TEST_F(coredump, stackdump)
|
||||
char *test_dir, *line;
|
||||
size_t line_length;
|
||||
char buf[PATH_MAX];
|
||||
int ret, i;
|
||||
int ret, i, status;
|
||||
FILE *file;
|
||||
pid_t pid;
|
||||
|
||||
@@ -129,6 +129,10 @@ TEST_F(coredump, stackdump)
|
||||
/*
|
||||
* Step 3: Wait for the stackdump script to write the stack pointers to the stackdump file
|
||||
*/
|
||||
waitpid(pid, &status, 0);
|
||||
ASSERT_TRUE(WIFSIGNALED(status));
|
||||
ASSERT_TRUE(WCOREDUMP(status));
|
||||
|
||||
for (i = 0; i < 10; ++i) {
|
||||
file = fopen(STACKDUMP_FILE, "r");
|
||||
if (file)
|
||||
|
||||
Reference in New Issue
Block a user