You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by to...@apache.org on 2015/03/20 17:24:48 UTC

[7/8] incubator-usergrid git commit: Fixes test that won't work when the system runs too quickly.

Fixes test that won't work when the system runs too quickly.


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/6dc742e4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/6dc742e4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/6dc742e4

Branch: refs/heads/USERGRID-486
Commit: 6dc742e402bf75a8cf6bb0f2fa3ffc4c07367263
Parents: 5889a3b
Author: Todd Nine <tn...@apigee.com>
Authored: Fri Mar 20 07:30:55 2015 -0600
Committer: Todd Nine <tn...@apigee.com>
Committed: Fri Mar 20 07:30:55 2015 -0600

----------------------------------------------------------------------
 .../usergrid/persistence/graph/GraphManagerIT.java | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/6dc742e4/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerIT.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerIT.java b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerIT.java
index ef5d69d..05b36fe 100644
--- a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerIT.java
+++ b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/GraphManagerIT.java
@@ -964,20 +964,25 @@ public abstract class GraphManagerIT {
         Id targetId2 = new SimpleId( "target2" );
 
 
-        Edge edge1 = createEdge( sourceId, "test", targetId1, System.currentTimeMillis() );
+        long startTime = System.currentTimeMillis();
+
+        long edge1Time = startTime;
+        long edge2Time = edge1Time+1;
+
+        final long maxVersion= edge2Time;
+
+        Edge edge1 = createEdge( sourceId, "test", targetId1, edge1Time);
 
         gm.writeEdge( edge1 ).toBlocking().singleOrDefault( null );
 
-        Edge edge2 = createEdge( sourceId, "test", targetId2, System.currentTimeMillis() );
+        Edge edge2 = createEdge( sourceId, "test", targetId2, edge2Time );
 
         gm.writeEdge( edge2 ).toBlocking().singleOrDefault( null );
 
 
-        final long maxVersion = System.currentTimeMillis();
-
 
-        assertTrue( Long.compare( maxVersion, edge2.getTimestamp() ) > 0 );
-        assertTrue( Long.compare( maxVersion, edge1.getTimestamp() ) > 0 );
+        assertTrue( Long.compare( maxVersion, edge2.getTimestamp() ) >= 0 );
+        assertTrue( Long.compare( maxVersion, edge1.getTimestamp() ) >= 0 );
 
 
         //get our 2 edges