Skip to content

Commit

Permalink
fixed basicc hopefully, and made ctest clean data dir before running #…
Browse files Browse the repository at this point in the history
  • Loading branch information
leifwalsh committed Jan 28, 2014
1 parent d4ea9e6 commit 46abcd7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
9 changes: 8 additions & 1 deletion jstests/CMakeLists.txt
Expand Up @@ -3,6 +3,10 @@ if (BUILD_TESTING)
set(js_dbpath "${js_ctest_root}/db")
set(js_logpath "${js_ctest_root}/log")
file(MAKE_DIRECTORY "${js_dbpath}")
add_test(
NAME mongo/js/clean-mongod-dbpath
COMMAND rm -rf "${js_dbpath}/*"
)
add_test(
NAME mongo/js/start-mongod
COMMAND $<TARGET_FILE:mongod>
Expand All @@ -12,9 +16,12 @@ if (BUILD_TESTING)
--logpath "${js_logpath}"
--setParameter enableTestCommands=1
)
set_tests_properties(mongo/js/start-mongod PROPERTIES
DEPENDS mongo/js/clean-mongod-dbpath
)
add_test(
NAME mongo/js/check-mongod
COMMAND /bin/bash -c "for i in `seq 1 180`; do if $<TARGET_FILE:mongo> --port 27999 --eval 'db.version()'; then break; fi; if [ $i = 60 ]; then exit 1; fi; sleep 1; done"
COMMAND /bin/bash -c "for i in `seq 1 180`; do if $<TARGET_FILE:mongo> --port 27999 --eval 'db.version()'; then break; fi; if [ $i = 180 ]; then exit 1; fi; sleep 1; done"
)
set_tests_properties(mongo/js/check-mongod PROPERTIES
DEPENDS mongo/js/start-mongod
Expand Down
6 changes: 1 addition & 5 deletions jstests/basicc.js
Expand Up @@ -5,8 +5,7 @@ t2 = db.jstests_basicc2;
t1.drop();
t2.drop();

var db = db.getSisterDB("test_basicc");
js = "for (i = 0; i < 20000; i++) { db.getSiblingDB('" + db.getName() + "').jstests_basicc1.save( {} ); }";
js = "db = db.getSiblingDB('" + db.getName() + "'); for (i = 0; i < 20000; i++) { db.jstests_basicc1.save( {} ); }";
pid = startMongoProgramNoConnect( "mongo" , "--eval" , js , db.getMongo().host );
for( var i = 0; i < 20000; ++i ) {
t2.save( {} );
Expand All @@ -18,6 +17,3 @@ assert.soon( function() { return t1.count() == 20000 && t2.count() == 20000 }, 3
t1.drop();
t2.drop();
db.dropDatabase();
db = db.getSisterDB("test");
print('Done.');

0 comments on commit 46abcd7

Please sign in to comment.