diff --git a/src/tests/Makefile b/src/tests/Makefile index 46854ce3748..ef571945867 100644 --- a/src/tests/Makefile +++ b/src/tests/Makefile @@ -168,8 +168,7 @@ TDB_TESTS_THAT_SHOULD_FAIL= \ test_groupcommit_count \ test944 \ test_truncate_txn_abort \ - test_db_no_env \ - diskfull \ + test_db_no_env #\ ends prev line #ifneq ($(OS_CHOICE),windows) # TDB_TESTS_THAT_SHOULD_FAIL+= \ @@ -433,6 +432,8 @@ test_groupcommit_perf.bdbrun test_groupcommit_perf.tdbrun: VGRIND= # $(HGRIND) ./$< $(VERBVERBOSE) +# Don't run valgrind on the diskfull test (since it aborts) +diskfull.tdbrun: VGRIND= libs: cd ..;$(MAKE) diff --git a/src/tests/diskfull.c b/src/tests/diskfull.c index a6834d8ad36..e895c500a47 100644 --- a/src/tests/diskfull.c +++ b/src/tests/diskfull.c @@ -6,6 +6,8 @@ #include #include +#include +#include #define DOERR(r) do { if (r!=0) { did_fail=1; fprintf(error_file, "%s:%d error %d (%s)\n", __FILE__, __LINE__, r, db_strerror(r)); }} while (0) @@ -174,7 +176,21 @@ do_writes_that_fail (void) { for (fail_at = 0; fail_at=0); + { int r = dup2(devnul, fileno(stderr)); assert(r==fileno(stderr)); } + { int r = close(devnul); assert(r==0); } + do_db_work(); + exit(1); + } else { + int status; + pid_t r = waitpid(child, &status, 0); + assert(r==child); + assert(WIFSIGNALED(status)); + assert(WTERMSIG(status)==SIGABRT); + } } // fail_at = FAIL_NEVER; write_count=0;