diff options
| -rw-r--r-- | src/testing/nuts.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/testing/nuts.h b/src/testing/nuts.h index f2e50c2c..421e0a53 100644 --- a/src/testing/nuts.h +++ b/src/testing/nuts.h @@ -23,8 +23,15 @@ extern void nuts_logger( nng_log_level, nng_log_facility, const char *, const char *); // Call nng_fini during test finalization -- this avoids leak warnings. +// We add a 20 millisecond delay as a hack to allow for other subsytems to +// drain first. (Notably the HTTP framework can fail if we shut down too +// quickly. These bugs should be fixed and then the sleep can be removed.) #ifndef TEST_FINI -#define TEST_FINI nng_fini() +#define TEST_FINI \ + do { \ + nng_msleep(20); \ + nng_fini(); \ + } while (0) #endif #ifndef TEST_INIT |
