Commit e2c57ca0 authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul Committed by Yoni Fogel

diskfull.tdbrun now works. Fixes #2290. close[t:2290]

git-svn-id: file:///svn/toku/tokudb@16854 c7de825b-a66e-492c-adef-691d508d4ae1
parent a8b7da5b
...@@ -168,8 +168,7 @@ TDB_TESTS_THAT_SHOULD_FAIL= \ ...@@ -168,8 +168,7 @@ TDB_TESTS_THAT_SHOULD_FAIL= \
test_groupcommit_count \ test_groupcommit_count \
test944 \ test944 \
test_truncate_txn_abort \ test_truncate_txn_abort \
test_db_no_env \ test_db_no_env
diskfull \
#\ ends prev line #\ ends prev line
#ifneq ($(OS_CHOICE),windows) #ifneq ($(OS_CHOICE),windows)
# TDB_TESTS_THAT_SHOULD_FAIL+= \ # TDB_TESTS_THAT_SHOULD_FAIL+= \
...@@ -433,6 +432,8 @@ test_groupcommit_perf.bdbrun test_groupcommit_perf.tdbrun: VGRIND= ...@@ -433,6 +432,8 @@ test_groupcommit_perf.bdbrun test_groupcommit_perf.tdbrun: VGRIND=
# $(HGRIND) ./$< $(VERBVERBOSE) # $(HGRIND) ./$< $(VERBVERBOSE)
# Don't run valgrind on the diskfull test (since it aborts)
diskfull.tdbrun: VGRIND=
libs: libs:
cd ..;$(MAKE) cd ..;$(MAKE)
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
#include <fcntl.h> #include <fcntl.h>
#include <errno.h> #include <errno.h>
#include <unistd.h>
#include <sys/wait.h>
#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) #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) { ...@@ -174,7 +176,21 @@ do_writes_that_fail (void) {
for (fail_at = 0; fail_at<count; fail_at++) { for (fail_at = 0; fail_at<count; fail_at++) {
if (verbose) fprintf(stderr, "About to fail at %d:\n", fail_at); if (verbose) fprintf(stderr, "About to fail at %d:\n", fail_at);
write_count=0; write_count=0;
pid_t child;
if ((child=fork())==0) {
int devnul = open("/dev/null", O_WRONLY);
assert(devnul>=0);
{ int r = dup2(devnul, fileno(stderr)); assert(r==fileno(stderr)); }
{ int r = close(devnul); assert(r==0); }
do_db_work(); 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; // fail_at = FAIL_NEVER; write_count=0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment