diff options
author | Keith Bostic <keith@wiredtiger.com> | 2014-11-21 21:26:10 -0500 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2014-11-21 21:26:10 -0500 |
commit | 47a3bd9bdfa84690fe8256ffff5d8a94b0b6aa8b (patch) | |
tree | f19d58a06d1aba494da4f84d2dc7734f03cbd0df /test/fops/fops.c | |
parent | ef68e3e50b40657a779c85f7465ebaf9933d7c81 (diff) | |
download | mongo-47a3bd9bdfa84690fe8256ffff5d8a94b0b6aa8b.tar.gz |
Add tests for creating bulk and non-bulk items that we know will succeed;
I did this change to test for #1397, but it's a reasonable way to do more
testing in fops.
Diffstat (limited to 'test/fops/fops.c')
-rw-r--r-- | test/fops/fops.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/test/fops/fops.c b/test/fops/fops.c index 6dc3904fb2f..0a5cce87ea3 100644 --- a/test/fops/fops.c +++ b/test/fops/fops.c @@ -32,8 +32,10 @@ static void print_stats(u_int); typedef struct { int bulk; /* bulk load */ + int bulk_unique; /* bulk load of new file */ int ckpt; /* session.checkpoint */ int create; /* session.create */ + int create_unique; /* session.create of new file */ int cursor; /* session.open_cursor */ int drop; /* session.drop */ int upgrade; /* session.upgrade */ @@ -117,16 +119,16 @@ static void * fop(void *arg) { STATS *s; + uintptr_t id; u_int i; - int id; - id = (int)(uintptr_t)arg; + id = (uintptr_t)arg; sched_yield(); /* Get all the threads created. */ s = &run_stats[id]; for (i = 0; i < nops; ++i, sched_yield()) - switch (r() % 7) { + switch (r() % 9) { case 0: ++s->bulk; obj_bulk(); @@ -155,6 +157,14 @@ fop(void *arg) ++s->verify; obj_verify(); break; + case 7: + ++s->bulk_unique; + obj_bulk_unique(); + break; + case 8: + ++s->create_unique; + obj_create_unique(); + break; } return (NULL); @@ -175,6 +185,7 @@ print_stats(u_int nthreads) printf( "%2d: bulk %3d, ckpt %3d, create %3d, cursor %3d, " "drop %3d, upg %3d, vrfy %3d\n", - id, s->bulk, s->ckpt, s->create, s->cursor, + id, s->bulk + s->bulk_unique, s->ckpt, + s->create + s->create_unique, s->cursor, s->drop, s->upgrade, s->verify); } |