summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/test/fops
diff options
context:
space:
mode:
authorAlex Gorrod <alexander.gorrod@mongodb.com>2017-10-03 11:36:35 +1100
committerAlex Gorrod <alexander.gorrod@mongodb.com>2017-10-03 11:36:35 +1100
commita7d8f125b9f7db197d20800802016a671d9949c5 (patch)
tree7084f736abe44c9e57e929d2be08ec28154825de /src/third_party/wiredtiger/test/fops
parenta7efca41eb8b864f38239a77e2816b24c48fa899 (diff)
downloadmongo-a7d8f125b9f7db197d20800802016a671d9949c5.tar.gz
Import wiredtiger: 6f561957cb5606f504f9fe5a124c80386b210b1a from branch mongodb-3.6
ref: e2c927fa58..6f561957cb for: 3.5.14 WT-3230 automatic style checking: function local variable declarations WT-3252 Remove the reconciliation WT_BOUNDARY structure. WT-3430 Add statistics tracking transaction ID/timestamp queue usage WT-3437 Evaluate improvements to tuning of number of eviction workers WT-3449 Get the Helium software running again. WT-3457 Enhance checkpoint scrub algorithm WT-3468 Ensure time comparison is done in thread-safe manner WT-3474 Extend Python timestamp rollback test case WT-3510 Add tests to check different sized timestamps and timestamps turned off WT-3511 Add test for timestamp changing partway during a multi-step transaction WT-3512 Add tests to catch improper usage of timestamp API WT-3524 Test format likely to pin cache full when enabling timestamps WT-3533 eviction handle walk can race with handle re-open WT-3537 Split pages when nothing can be written WT-3543 Ensure that failed checkpoints cleanup properly WT-3555 Streamline open cursor for tables WT-3556 remove wtstats support from WiredTiger WT-3557 Make test/format ignore unknown keywords WT-3561 test/recovery hangs with timestamps disabled WT-3571 clsm_open_cursors() set incorrct chunk->count WT-3572 format should limit runs to 6 hours. WT-3574 timestamp abort does not need to increment with atomic op WT-3575 ASCII statistics log printing WT-3576 Update test_timestamp09 to use integer comparison of timestamps WT-3578 Failed to parse oldest timestamp '0': zero not permitted WT-3581 format: unexpected checkpoint resolution WT-3588 test/format references freed memory. WT-3589 replace return checks and testutil_die() pairs, with testutil_check(). WT-3590 Keep data consistent if writes fail during a clean shutdown WT-3595 Make sure the Python example gets the right _wiredtiger.so WT-3601 Coverity 1381365: bt_split.c:__split_ref_move() resource leak WT-3602 compatible=(release=2.9) is insufficient for downgrading to 2.9 WT-3603 format threads always traverse the same RNG space. WT-3605 LSM doesn't support type 'r' WT-3606 reconfigure compatibility error paths leave system in modified state WT-3609 Coverity 1381438: change __wt_panic to handle a NULL session argument WT-3610 Relax commit timestamp ordering check WT-3614 Full-build Friday lint
Diffstat (limited to 'src/third_party/wiredtiger/test/fops')
-rw-r--r--src/third_party/wiredtiger/test/fops/file.c96
-rw-r--r--src/third_party/wiredtiger/test/fops/fops.c2
-rw-r--r--src/third_party/wiredtiger/test/fops/t.c16
3 files changed, 39 insertions, 75 deletions
diff --git a/src/third_party/wiredtiger/test/fops/file.c b/src/third_party/wiredtiger/test/fops/file.c
index 1bb13f8a4de..60320ae3a38 100644
--- a/src/third_party/wiredtiger/test/fops/file.c
+++ b/src/third_party/wiredtiger/test/fops/file.c
@@ -37,8 +37,7 @@ obj_bulk(void)
WT_SESSION *session;
int ret;
- if ((ret = conn->open_session(conn, NULL, NULL, &session)) != 0)
- testutil_die(ret, "conn.session");
+ testutil_check(conn->open_session(conn, NULL, NULL, &session));
if ((ret = session->create(session, uri, config)) != 0)
if (ret != EEXIST && ret != EBUSY)
@@ -48,13 +47,11 @@ obj_bulk(void)
__wt_yield();
if ((ret = session->open_cursor(
session, uri, NULL, "bulk", &c)) == 0) {
- if ((ret = c->close(c)) != 0)
- testutil_die(ret, "cursor.close");
+ testutil_check(c->close(c));
} else if (ret != ENOENT && ret != EBUSY && ret != EINVAL)
testutil_die(ret, "session.open_cursor bulk");
}
- if ((ret = session->close(session, NULL)) != 0)
- testutil_die(ret, "session.close");
+ testutil_check(session->close(session, NULL));
}
void
@@ -65,19 +62,15 @@ obj_bulk_unique(int force)
int ret;
char new_uri[64];
- if ((ret = conn->open_session(conn, NULL, NULL, &session)) != 0)
- testutil_die(ret, "conn.session");
+ testutil_check(conn->open_session(conn, NULL, NULL, &session));
/* Generate a unique object name. */
- if ((ret = pthread_rwlock_wrlock(&single)) != 0)
- testutil_die(ret, "pthread_rwlock_wrlock single");
+ testutil_check(pthread_rwlock_wrlock(&single));
testutil_check(__wt_snprintf(
new_uri, sizeof(new_uri), "%s.%u", uri, ++uid));
- if ((ret = pthread_rwlock_unlock(&single)) != 0)
- testutil_die(ret, "pthread_rwlock_unlock single");
+ testutil_check(pthread_rwlock_unlock(&single));
- if ((ret = session->create(session, new_uri, config)) != 0)
- testutil_die(ret, "session.create: %s", new_uri);
+ testutil_check(session->create(session, new_uri, config));
__wt_yield();
/*
@@ -85,10 +78,9 @@ obj_bulk_unique(int force)
* which created a checkpoint of the empty file, and triggers an EINVAL
*/
if ((ret = session->open_cursor(
- session, new_uri, NULL, "bulk", &c)) == 0) {
- if ((ret = c->close(c)) != 0)
- testutil_die(ret, "cursor.close");
- } else if (ret != EINVAL)
+ session, new_uri, NULL, "bulk", &c)) == 0)
+ testutil_check(c->close(c));
+ else if (ret != EINVAL)
testutil_die(ret,
"session.open_cursor bulk unique: %s, new_uri");
@@ -97,30 +89,25 @@ obj_bulk_unique(int force)
if (ret != EBUSY)
testutil_die(ret, "session.drop: %s", new_uri);
- if ((ret = session->close(session, NULL)) != 0)
- testutil_die(ret, "session.close");
+ testutil_check(session->close(session, NULL));
}
void
obj_cursor(void)
{
- WT_SESSION *session;
WT_CURSOR *cursor;
+ WT_SESSION *session;
int ret;
- if ((ret = conn->open_session(conn, NULL, NULL, &session)) != 0)
- testutil_die(ret, "conn.session");
+ testutil_check(conn->open_session(conn, NULL, NULL, &session));
if ((ret =
session->open_cursor(session, uri, NULL, NULL, &cursor)) != 0) {
if (ret != ENOENT && ret != EBUSY)
testutil_die(ret, "session.open_cursor");
- } else {
- if ((ret = cursor->close(cursor)) != 0)
- testutil_die(ret, "cursor.close");
- }
- if ((ret = session->close(session, NULL)) != 0)
- testutil_die(ret, "session.close");
+ } else
+ testutil_check(cursor->close(cursor));
+ testutil_check(session->close(session, NULL));
}
void
@@ -129,15 +116,13 @@ obj_create(void)
WT_SESSION *session;
int ret;
- if ((ret = conn->open_session(conn, NULL, NULL, &session)) != 0)
- testutil_die(ret, "conn.session");
+ testutil_check(conn->open_session(conn, NULL, NULL, &session));
if ((ret = session->create(session, uri, config)) != 0)
if (ret != EEXIST && ret != EBUSY)
testutil_die(ret, "session.create");
- if ((ret = session->close(session, NULL)) != 0)
- testutil_die(ret, "session.close");
+ testutil_check(session->close(session, NULL));
}
void
@@ -147,19 +132,15 @@ obj_create_unique(int force)
int ret;
char new_uri[64];
- if ((ret = conn->open_session(conn, NULL, NULL, &session)) != 0)
- testutil_die(ret, "conn.session");
+ testutil_check(conn->open_session(conn, NULL, NULL, &session));
/* Generate a unique object name. */
- if ((ret = pthread_rwlock_wrlock(&single)) != 0)
- testutil_die(ret, "pthread_rwlock_wrlock single");
+ testutil_check(pthread_rwlock_wrlock(&single));
testutil_check(__wt_snprintf(
new_uri, sizeof(new_uri), "%s.%u", uri, ++uid));
- if ((ret = pthread_rwlock_unlock(&single)) != 0)
- testutil_die(ret, "pthread_rwlock_unlock single");
+ testutil_check(pthread_rwlock_unlock(&single));
- if ((ret = session->create(session, new_uri, config)) != 0)
- testutil_die(ret, "session.create");
+ testutil_check(session->create(session, new_uri, config));
__wt_yield();
while ((ret = session->drop(
@@ -167,8 +148,7 @@ obj_create_unique(int force)
if (ret != EBUSY)
testutil_die(ret, "session.drop: %s", new_uri);
- if ((ret = session->close(session, NULL)) != 0)
- testutil_die(ret, "session.close");
+ testutil_check(session->close(session, NULL));
}
void
@@ -177,15 +157,13 @@ obj_drop(int force)
WT_SESSION *session;
int ret;
- if ((ret = conn->open_session(conn, NULL, NULL, &session)) != 0)
- testutil_die(ret, "conn.session");
+ testutil_check(conn->open_session(conn, NULL, NULL, &session));
if ((ret = session->drop(session, uri, force ? "force" : NULL)) != 0)
if (ret != ENOENT && ret != EBUSY)
testutil_die(ret, "session.drop");
- if ((ret = session->close(session, NULL)) != 0)
- testutil_die(ret, "session.close");
+ testutil_check(session->close(session, NULL));
}
void
@@ -194,8 +172,7 @@ obj_checkpoint(void)
WT_SESSION *session;
int ret;
- if ((ret = conn->open_session(conn, NULL, NULL, &session)) != 0)
- testutil_die(ret, "conn.session");
+ testutil_check(conn->open_session(conn, NULL, NULL, &session));
/*
* Force the checkpoint so it has to be taken. Forced checkpoints can
@@ -206,8 +183,7 @@ obj_checkpoint(void)
if (ret != EBUSY && ret != ENOENT)
testutil_die(ret, "session.checkpoint");
- if ((ret = session->close(session, NULL)) != 0)
- testutil_die(ret, "session.close");
+ testutil_check(session->close(session, NULL));
}
void
@@ -216,15 +192,13 @@ obj_rebalance(void)
WT_SESSION *session;
int ret;
- if ((ret = conn->open_session(conn, NULL, NULL, &session)) != 0)
- testutil_die(ret, "conn.session");
+ testutil_check(conn->open_session(conn, NULL, NULL, &session));
if ((ret = session->rebalance(session, uri, NULL)) != 0)
if (ret != ENOENT && ret != EBUSY)
testutil_die(ret, "session.rebalance");
- if ((ret = session->close(session, NULL)) != 0)
- testutil_die(ret, "session.close");
+ testutil_check(session->close(session, NULL));
}
void
@@ -233,15 +207,13 @@ obj_upgrade(void)
WT_SESSION *session;
int ret;
- if ((ret = conn->open_session(conn, NULL, NULL, &session)) != 0)
- testutil_die(ret, "conn.session");
+ testutil_check(conn->open_session(conn, NULL, NULL, &session));
if ((ret = session->upgrade(session, uri, NULL)) != 0)
if (ret != ENOENT && ret != EBUSY)
testutil_die(ret, "session.upgrade");
- if ((ret = session->close(session, NULL)) != 0)
- testutil_die(ret, "session.close");
+ testutil_check(session->close(session, NULL));
}
void
@@ -250,13 +222,11 @@ obj_verify(void)
WT_SESSION *session;
int ret;
- if ((ret = conn->open_session(conn, NULL, NULL, &session)) != 0)
- testutil_die(ret, "conn.session");
+ testutil_check(conn->open_session(conn, NULL, NULL, &session));
if ((ret = session->verify(session, uri, NULL)) != 0)
if (ret != ENOENT && ret != EBUSY)
testutil_die(ret, "session.verify");
- if ((ret = session->close(session, NULL)) != 0)
- testutil_die(ret, "session.close");
+ testutil_check(session->close(session, NULL));
}
diff --git a/src/third_party/wiredtiger/test/fops/fops.c b/src/third_party/wiredtiger/test/fops/fops.c
index cf182d757e2..9f2257d8e96 100644
--- a/src/third_party/wiredtiger/test/fops/fops.c
+++ b/src/third_party/wiredtiger/test/fops/fops.c
@@ -50,8 +50,8 @@ void
fop_start(u_int nthreads)
{
struct timeval start, stop;
- double seconds;
wt_thread_t *tids;
+ double seconds;
u_int i;
tids = NULL; /* Silence GCC 4.1 warning. */
diff --git a/src/third_party/wiredtiger/test/fops/t.c b/src/third_party/wiredtiger/test/fops/t.c
index 2357b170e49..b6b80ba5db8 100644
--- a/src/third_party/wiredtiger/test/fops/t.c
+++ b/src/third_party/wiredtiger/test/fops/t.c
@@ -67,13 +67,12 @@ main(int argc, char *argv[])
{ NULL, NULL, NULL }
};
u_int nthreads;
- int ch, cnt, ret, runs;
+ int ch, cnt, runs;
char *config_open, *working_dir;
(void)testutil_set_progname(argv);
- if ((ret = pthread_rwlock_init(&single, NULL)) != 0)
- testutil_die(ret, "pthread_rwlock_init: single");
+ testutil_check(pthread_rwlock_init(&single, NULL));
nops = 1000;
nthreads = 10;
@@ -151,7 +150,6 @@ wt_startup(char *config_open)
NULL,
NULL /* Close handler. */
};
- int ret;
char config_buf[128];
testutil_make_work_dir(home);
@@ -161,9 +159,8 @@ wt_startup(char *config_open)
progname,
config_open == NULL ? "" : ",",
config_open == NULL ? "" : config_open));
- if ((ret = wiredtiger_open(
- home, &event_handler, config_buf, &conn)) != 0)
- testutil_die(ret, "wiredtiger_open");
+ testutil_check(
+ wiredtiger_open(home, &event_handler, config_buf, &conn));
}
/*
@@ -173,10 +170,7 @@ wt_startup(char *config_open)
static void
wt_shutdown(void)
{
- int ret;
-
- if ((ret = conn->close(conn, NULL)) != 0)
- testutil_die(ret, "conn.close");
+ testutil_check(conn->close(conn, NULL));
}
/*