Skip to content
Browse files

Make test less sensitive to differences between time() and gettimeofd…

…ay()
  • Loading branch information...
1 parent 3bc8e32 commit 0e11df0b41db7802dc3565a7a666f6af1a9e4b93 @RedBeard0531 RedBeard0531 committed Feb 9, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 jstests/objid6.js
View
6 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" );

0 comments on commit 0e11df0

Please sign in to comment.
Something went wrong with that request. Please try again.