Skip to content

Commit b60ef4f

Browse files
authored
Merge pull request #2351 from beyonnex-io/bugfix/tpa-flaky-test-ci
Fix ThingPersistenceActorTest flaky timeout on CI with 1-2 cores
2 parents 18434be + d75b2ae commit b60ef4f

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

things/service/src/test/java/org/eclipse/ditto/things/service/persistence/actors/ThingPersistenceActorTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2146,7 +2146,10 @@ public void policyShouldNotBeDeletedOnThingRetrieveAndActorFail() {
21462146
RetrieveThing retrieveThing = RetrieveThing.of(thingId, dittoHeaders);
21472147
underTest.tell(retrieveThing, getRef());
21482148
policiesShardRegionTestProbe.expectNoMessage();
2149-
expectMsgClass(ThingUnavailableException.class);
2149+
// Use explicit timeout: on CI with 1-2 cores, the child actor creation may not have
2150+
// completed yet when the command arrives, causing the supervisor to forward the command
2151+
// to the dying child via ask with localAskTimeoutDuringRecovery (5s in test config).
2152+
expectMsgClass(java.time.Duration.ofSeconds(10), ThingUnavailableException.class);
21502153
expectNoMessage();
21512154

21522155
}

things/service/src/test/resources/thing-test.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ thing {
1414
max = 10s
1515
random-factor = 0.2
1616
}
17+
local-ask {
18+
# Reduced from default 45s to avoid long waits in tests when ask is sent to a dead/dying child actor
19+
timeout-during-recovery = 5s
20+
}
1721
}
1822
merge {
1923
remove-empty-objects-after-patch-condition-filtering = false

0 commit comments

Comments
 (0)