libtest: display the times after a test timeout error

This is to help with test failure debugging.

Ref: #11328
Closes #11329
This commit is contained in:
Dan Fandrich 2023-06-16 13:30:09 -07:00
parent 39c234c429
commit 2c5c7abb15

View File

@ -440,12 +440,14 @@ extern int unitfail;
tv_test_start = tutil_tvnow(); \
} while(0)
#define exe_test_timedout(Y,Z) do { \
if(tutil_tvdiff(tutil_tvnow(), tv_test_start) > TEST_HANG_TIMEOUT) { \
fprintf(stderr, "%s:%d ABORTING TEST, since it seems " \
"that it would have run forever.\n", (Y), (Z)); \
res = TEST_ERR_RUNS_FOREVER; \
} \
#define exe_test_timedout(Y,Z) do { \
long timediff = tutil_tvdiff(tutil_tvnow(), tv_test_start); \
if(timediff > (TEST_HANG_TIMEOUT)) { \
fprintf(stderr, "%s:%d ABORTING TEST, since it seems " \
"that it would have run forever (%ld ms > %ld ms)\n", \
(Y), (Z), timediff, (long) (TEST_HANG_TIMEOUT)); \
res = TEST_ERR_RUNS_FOREVER; \
} \
} while(0)
#define res_test_timedout() \