problem: sporadic unit-test failure

This commit is contained in:
Igor Artamonov
2020-05-16 17:17:21 -04:00
parent 1d947aeb9d
commit 8d49856ffd
4 changed files with 6 additions and 2 deletions

View File

@@ -113,6 +113,6 @@ class TrackEthereumAddressSpec extends Specification {
} }
.expectNext(exp2).as("Second block") .expectNext(exp2).as("Second block")
.thenCancel() .thenCancel()
.verify(Duration.ofSeconds(1)) .verify(Duration.ofSeconds(2))
} }
} }

View File

@@ -31,6 +31,7 @@ class EthereumHeadMock implements Head {
void nextBlock(BlockContainer block) { void nextBlock(BlockContainer block) {
assert block != null assert block != null
println("New block: ${block.height} / ${block.hash}")
latest = block latest = block
bus.onNext(block) bus.onNext(block)
} }

View File

@@ -65,6 +65,7 @@ class EthereumUpstreamMock extends EthereumUpstream {
methods, TestingCommons.objectMapper()) methods, TestingCommons.objectMapper())
setLag(0) setLag(0)
setStatus(UpstreamAvailability.OK) setStatus(UpstreamAvailability.OK)
start()
} }
void nextBlock(BlockContainer block) { void nextBlock(BlockContainer block) {

View File

@@ -76,7 +76,9 @@ class TestingCommons {
} }
static Multistream aggregatedUpstream(EthereumUpstream up) { static Multistream aggregatedUpstream(EthereumUpstream up) {
return new EthereumMultistream(Chain.ETHEREUM, [up], Caches.default(objectMapper()), objectMapper()) return new EthereumMultistream(Chain.ETHEREUM, [up], Caches.default(objectMapper()), objectMapper()).tap {
start()
}
} }
static CachesFactory emptyCaches() { static CachesFactory emptyCaches() {