Problem
Several MicroProfile integration tests use a hard-coded Thread.sleep(10_000) before
querying the mirror node:
AccountRepositoryTest – 1 occurrence
TokenRepositoryTest – 6 occurrences
TopicRepositoryTest – 4 occurrences
Each call has a // TODO: fix sleep comment acknowledging the issue. Fixed sleeps have
two drawbacks:
- Slow – always waits the full 10 s even when the mirror node has already indexed the
record.
- Flaky – may still time out when the mirror node is under load or the network is slow.
The Spring integration tests already use HieroTestUtils.waitForMirrorNodeRecords(),
which polls until the last submitted transaction appears in the mirror node (or times out),
making them faster on a healthy network and more reliable under load.
Expected behaviour
All MicroProfile integration tests replace Thread.sleep(10_000) with
hieroTestUtils.waitForMirrorNodeRecords(), consistent with the Spring test suite.
Scope
hiero-enterprise-microprofile/.../AccountRepositoryTest.java
hiero-enterprise-microprofile/.../TokenRepositoryTest.java
hiero-enterprise-microprofile/.../TopicRepositoryTest.java
Problem
Several MicroProfile integration tests use a hard-coded
Thread.sleep(10_000)beforequerying the mirror node:
AccountRepositoryTest– 1 occurrenceTokenRepositoryTest– 6 occurrencesTopicRepositoryTest– 4 occurrencesEach call has a
// TODO: fix sleepcomment acknowledging the issue. Fixed sleeps havetwo drawbacks:
record.
The Spring integration tests already use
HieroTestUtils.waitForMirrorNodeRecords(),which polls until the last submitted transaction appears in the mirror node (or times out),
making them faster on a healthy network and more reliable under load.
Expected behaviour
All MicroProfile integration tests replace
Thread.sleep(10_000)withhieroTestUtils.waitForMirrorNodeRecords(), consistent with the Spring test suite.Scope
hiero-enterprise-microprofile/.../AccountRepositoryTest.javahiero-enterprise-microprofile/.../TokenRepositoryTest.javahiero-enterprise-microprofile/.../TopicRepositoryTest.java