Skip to content

Commit

Permalink
Add test retries when testcase process throws signal 4
Browse files Browse the repository at this point in the history
  • Loading branch information
SanderMertens committed Oct 30, 2023
1 parent 5911ca8 commit 62f2355
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/test/src/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,9 @@ void* bake_test_run_suite_range(
int8_t rc = 0;
int sig = 0;
bool proc_fail = false;
int32_t retry_count = 0;

retry:
memset(&proc, 0, sizeof(ut_proc));

if (prefix) {
Expand Down Expand Up @@ -251,6 +253,14 @@ void* bake_test_run_suite_range(
ut_log(
"#[red]FAIL#[reset]: %s segfaulted\n", test_name);
} else {
if (sig == 4) {
retry_count ++;
if (retry_count < 5) {
goto retry;
} else {
ut_log("#[red]retried 5 times after sig 4\n");
}
}
ut_log(
"#[red]FAIL#[reset]: %s exited with signal %d\n",
test_name, sig);
Expand Down

0 comments on commit 62f2355

Please sign in to comment.