File tree 1 file changed +5
-0
lines changed
eclair-core/src/test/scala/fr/acinq/eclair/blockchain/bitcoind
1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -243,6 +243,11 @@ class ZmqWatcherSpec extends TestKitBaseClass with AnyFunSuiteLike with Bitcoind
243
243
probe.expectMsg(tx2.txid)
244
244
listener.expectNoMessage(1 second)
245
245
246
+ // We must unsubscribe the watcher from ZMQ tx subscriptions, otherwise this test has a race condition because
247
+ // bitcoind sends us a NewTransaction event for each transaction inside a new block. If these are delayed and are
248
+ // received after we registered our watch, we will receive the watch-triggered event twice.
249
+ system.eventStream.unsubscribe(watcher.ref.toClassic, classOf [NewTransaction ])
250
+
246
251
system.eventStream.subscribe(probe.ref, classOf [CurrentBlockCount ])
247
252
generateBlocks(1 )
248
253
awaitCond(probe.expectMsgType[CurrentBlockCount ].blockCount >= initialBlockCount + 2 )
You can’t perform that action at this time.
0 commit comments