Skip to content

Commit 43571ae

Browse files
committed
test(spring): wait for network stake data in CI
Signed-off-by: Aman <amkr6207@gmail.com>
1 parent 472fad4 commit 43571ae

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

hiero-enterprise-spring/src/test/java/org/hiero/spring/test/NetworkRepositoryTest.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,15 @@ void findNetworkFees() throws HieroException {
3535
}
3636

3737
@Test
38-
void findNetworkStake() throws HieroException {
39-
Optional<NetworkStake> result = networkRepository.stake();
38+
void findNetworkStake() throws HieroException, InterruptedException {
39+
Optional<NetworkStake> result = Optional.empty();
40+
41+
for (int attempt = 0; attempt < 10 && result.isEmpty(); attempt++) {
42+
result = networkRepository.stake();
43+
if (result.isEmpty()) {
44+
Thread.sleep(500);
45+
}
46+
}
4047

4148
Assertions.assertNotNull(result);
4249
Assertions.assertTrue(result.isPresent());

0 commit comments

Comments
 (0)