[PATCH] tests: adapt to mongod's new default of using --journal

Jim Meyering jim at meyering.net
Thu Feb 23 20:37:45 UTC 2012


Jim Meyering wrote:
> V2 coming up.

BTW, thanks for the quick review.

Here's the incremental:

diff --git a/auto.c b/auto.c
index 291440b..cd54d88 100644
--- a/auto.c
+++ b/auto.c
@@ -27,7 +27,6 @@ static char auto_arg_port[10];

 static const char *const auto_arg_mongod[] = {
 	"mongod",
-	"--nojournal",
 	"--port", auto_arg_port,
 	"--dbpath", AUTO_DIR_DB,
 	/* "--fork", */	/* chdirs god knows where, we cannot use this. */
@@ -40,7 +39,6 @@ static const char *const auto_arg_mongod[] = {
 /* The --quiet option in mongod is useless, so redirect instead. */
 static const char *const auto_arg_mongod_quiet[] = {
 	"mongod",
-	"--nojournal",
 	"--port", auto_arg_port,
 	"--dbpath", AUTO_DIR_DB,
 	"--logpath", AUTO_MONGOD_LOG,
diff --git a/t/auto b/t/auto
index bde47a4..c8d4ee3 100755
--- a/t/auto
+++ b/t/auto
@@ -24,7 +24,7 @@ cleanup_() { kill $iwhd_pid; }

 # Wait longer than usual (i.e., don't use wait_for_mongo), since this
 # mongo daemon was started via iwhd itself, and not with $mongo_opt
-wait_for_mongo $m_port \
+wait_for .1 100 'mongo localhost:$m_port < /dev/null' \
   || framework_failure_ mongod failed to start
 # Wait for up to 20 seconds for iwhd to begin listening on $port.
 wait_for .1 200 "curl -s http://localhost:$port" \
diff --git a/t/init.cfg b/t/init.cfg
index e05fce8..87c23cb 100644
--- a/t/init.cfg
+++ b/t/init.cfg
@@ -51,7 +51,7 @@ wait_for_mongo()
 # If we ever stop using --nojournal here, expect to increase the
 # timeout above to something like ".1 * 300" (i.e., 30 seconds),
 # in order to accommodate the cost of journal initialization.
-mongo_opt='--nojournal'
+mongo_opt=$(mongod --help| grep -e --nojournal >/dev/null && echo --nojournal)

 emit_provider_list_prefix()
 {




More information about the iwhd-devel mailing list