summaryrefslogtreecommitdiff
path: root/jstests/objid6.js
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2012-02-09 17:35:06 -0500
committerMathias Stearn <mathias@10gen.com>2012-02-09 17:57:49 -0500
commit0e11df0b41db7802dc3565a7a666f6af1a9e4b93 (patch)
tree1980354007b864cc662a74440bb90b24a24c878f /jstests/objid6.js
parent3bc8e32a19f62911224d622ef2dfaacee64e548e (diff)
downloadmongo-0e11df0b41db7802dc3565a7a666f6af1a9e4b93.tar.gz
Make test less sensitive to differences between time() and gettimeofday()
Diffstat (limited to 'jstests/objid6.js')
-rw-r--r--jstests/objid6.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/jstests/objid6.js b/jstests/objid6.js
index c414ff0d0f6..b90dc9e914e 100644
--- a/jstests/objid6.js
+++ b/jstests/objid6.js
@@ -6,9 +6,11 @@ b = new ObjectId("4c17f616a707428966a2801c");
assert.eq(a.getTimestamp(), b.getTimestamp() , "A" );
x = Math.floor( (new Date()).getTime() / 1000 );
+sleep(10/*ms*/)
a = new ObjectId();
+sleep(10/*ms*/)
z = Math.floor( (new Date()).getTime() / 1000 );
y = a.getTimestamp().getTime() / 1000;
-assert( x <= y , "B" );
-assert( y <= z , "C" );
+assert.lte( x , y , "B" );
+assert.lte( y , z , "C" );