@@ -68,13 +68,13 @@ public void testList() {
6868 @ Test
6969 public void testSlowLog () {
7070 RedisGraph redisGraph = getRedisGraph ();
71- assertThat ( redisGraph . profile ( "social" , "CREATE (:person{name:'roi',age:32})" , 0L )). isNotEmpty ();
72- assertThat (redisGraph .profile ("social" , "CREATE (:person{name:'amit',age:30}) " , 0L )).isNotEmpty ();
71+ // only queries taking 10 ms or more are logged, so run something deliberately heavy
72+ assertThat (redisGraph .query ("social" , "UNWIND range(1, 2000000) AS x RETURN count(x) " , 0L )).isNotNull ();
7373
7474 List <SlowLogItem > slowLogItems = redisGraph .slowLog ("social" );
75- assertThat (slowLogItems ).isNotNull ();
76- assertThat (slowLogItems .size ()). isEqualTo ( 2 );
77- assertThat (slowLogItems .get (0 ).getCommand ()).isEqualToIgnoringCase ( "GRAPH.PROFILE " );
75+ assertThat (slowLogItems ).isNotEmpty ();
76+ assertThat (slowLogItems .get ( 0 ). getCommand ()). isEqualToIgnoringCase ( "GRAPH.QUERY" );
77+ assertThat (slowLogItems .get (0 ).getQuery ()).contains ( "UNWIND " );
7878 }
7979
8080 @ Test
@@ -178,7 +178,7 @@ public void testFalkorDbCommands() throws InterruptedException {
178178 assertThat (redisGraph .query ("social" , "CREATE (:person{name:'roi',age:32})" , 0L )).isNotNull ();
179179
180180 // constraints are validated asynchronously against existing data before they are enforced
181- assertThat (redisGraph .createConstraint ("social" , ConstraintType .MANDATORY , EntityType .NODE , "person" , "name" )).isTrue ( );
181+ assertThat (redisGraph .createConstraint ("social" , ConstraintType .MANDATORY , EntityType .NODE , "person" , "name" )).isEqualTo ( "PENDING" );
182182 awaitConstraintStatus (redisGraph , "OPERATIONAL" );
183183 assertThatThrownBy (() -> redisGraph .query ("social" , "CREATE (:person{age:1})" , 0L )).isInstanceOf (RedisException .class );
184184 assertThat (redisGraph .dropConstraint ("social" , ConstraintType .MANDATORY , EntityType .NODE , "person" , "name" )).isTrue ();
0 commit comments