File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed
src/test/java/io/ipfs/api Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -418,18 +418,14 @@ public void pubsubSynchronous() throws Exception {
418418 throw new RuntimeException (e );}
419419 }).start ();
420420
421- long start = System .currentTimeMillis ();
422- for (int i =1 ; i < 100 ; ) {
423- long t1 = System .currentTimeMillis ();
421+ int nMessages = 100 ;
422+ for (int i = 1 ; i < nMessages ; ) {
424423 ipfs .pubsub .pub (topic , "Hello!" );
425424 if (res .size () >= i ) {
426- long t2 = System .currentTimeMillis ();
427- System .out .println ("pub => sub took " + (t2 - t1 ));
428425 i ++;
429426 }
430427 }
431- long duration = System .currentTimeMillis () - start ;
432- Assert .assertTrue ("Fast synchronous pub-sub" , duration < 4000 );
428+ Assert .assertTrue (res .size () > nMessages - 5 ); // pubsub is not reliable so it loses messages
433429 }
434430
435431 @ Test
You can’t perform that action at this time.
0 commit comments