Skip to content

Commit d85c963

Browse files
test(pubsub): new approach for CI
1 parent 6b68dbb commit d85c963

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

test/CoreApi/PubSubApiTest.cs

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,10 @@ await ipfs.PubSub.Subscribe(topic, msg =>
5050
Interlocked.Increment(ref messageCount);
5151
});
5252
await ipfs.PubSub.Publish(topic, "hello world!");
53-
await ipfs.PubSub.Publish(topic, "hello world!!");
5453

55-
while (messageCount != 2)
56-
{
57-
await Task.Delay(1000);
58-
}
59-
}
54+
await Task.Delay(1000);
55+
Assert.AreEqual(1, messageCount);
56+
}
6057

6158
volatile int messageCount1 = 0;
6259

@@ -72,16 +69,13 @@ await ipfs.PubSub.Subscribe(topic, msg =>
7269
Interlocked.Increment(ref messageCount1);
7370
}, cs.Token);
7471
await ipfs.PubSub.Publish(topic, "hello world!");
75-
await ipfs.PubSub.Publish(topic, "hello world!!");
76-
while (messageCount1 != 2)
77-
{
78-
await Task.Delay(1000);
79-
}
72+
await Task.Delay(1000);
73+
Assert.AreEqual(1, messageCount1);
8074

8175
cs.Cancel();
8276
await ipfs.PubSub.Publish(topic, "hello world!!!");
83-
await Task.Delay(5000);
84-
Assert.AreEqual(2, messageCount1);
77+
await Task.Delay(1000);
78+
Assert.AreEqual(1, messageCount1);
8579
}
8680
}
8781
}

0 commit comments

Comments
 (0)