mirror of
https://github.com/MariaDB/server.git
synced 2025-02-02 12:01:42 +01:00
diskfull.tdbrun now works. Fixes #2290. close[t:2290]
git-svn-id: file:///svn/toku/tokudb@16854 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
df9884886b
commit
fb923aad34
2 changed files with 20 additions and 3 deletions
|
@ -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)
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
|
||||
#include <fcntl.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)
|
||||
|
||||
|
@ -174,7 +176,21 @@ do_writes_that_fail (void) {
|
|||
for (fail_at = 0; fail_at<count; fail_at++) {
|
||||
if (verbose) fprintf(stderr, "About to fail at %d:\n", fail_at);
|
||||
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();
|
||||
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;
|
||||
|
|
Loading…
Add table
Reference in a new issue