Skip to content

Commit 3306320

Browse files
committed
🚨test: Set short timeout values to expect... that is in 'awaitAssert'
1 parent 763944a commit 3306320

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

src/multi-jvm/scala/lerna/akka/entityreplication/RaftActorCompactionSpec.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ class RaftActorCompactionSpec extends MultiNodeSpec(RaftActorCompactionSpecConfi
153153
runOn(node1, node2, node3) {
154154
awaitAssert {
155155
replicationActor(myself) ! DummyReplicationActor.GetState(entityId)
156-
expectMsg(DummyReplicationActor.State(1))
156+
expectMsg(max = 1.second, DummyReplicationActor.State(1))
157157
}
158158
}
159159
enterBarrier("all ReplicationActor applied an event")
@@ -178,14 +178,14 @@ class RaftActorCompactionSpec extends MultiNodeSpec(RaftActorCompactionSpecConfi
178178
// ReplicationActor which has not been isolated applied all events
179179
awaitAssert {
180180
replicationActor(myself) ! DummyReplicationActor.GetState(entityId)
181-
expectMsg(DummyReplicationActor.State(4))
181+
expectMsg(max = 1.second, DummyReplicationActor.State(4))
182182
}
183183
}
184184
runOn(node3) {
185185
// ReplicationActor which has been isolated did not apply any events
186186
awaitAssert {
187187
replicationActor(myself) ! DummyReplicationActor.GetState(entityId)
188-
expectMsg(DummyReplicationActor.State(1))
188+
expectMsg(max = 1.second, DummyReplicationActor.State(1))
189189
}
190190
}
191191
enterBarrier("ReplicationActor which has not been isolated applied all events")

src/multi-jvm/scala/lerna/akka/entityreplication/RaftEventSourcedSpec.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,14 +199,14 @@ class RaftEventSourcedSpec extends MultiNodeSpec(RaftEventSourcedSpecConfig) wit
199199
awaitAssert(
200200
{
201201
clusterReplication ! DummyReplicationActor.Increment(entityId, requestId1, amount = 3)
202-
expectMsgType[DummyReplicationActor.State].knownRequestId should contain(requestId1)
202+
expectMsgType[DummyReplicationActor.State](max = 1.second).knownRequestId should contain(requestId1)
203203
},
204204
initializationTimeout,
205205
)
206206

207207
awaitAssert {
208208
clusterReplication ! DummyReplicationActor.Increment(entityId, requestId2, amount = 10)
209-
expectMsgType[DummyReplicationActor.State].knownRequestId should contain(requestId2)
209+
expectMsgType[DummyReplicationActor.State](max = 1.second).knownRequestId should contain(requestId2)
210210
}
211211

212212
val readJournal =

src/multi-jvm/scala/lerna/akka/entityreplication/ReplicationRegionSpec.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ class ReplicationRegionSpec extends MultiNodeSpec(ReplicationRegionSpecConfig) w
285285
val replicationActorPath = s"/system/sharding/raft-shard-$typeName-$role/$clusterShard/$raftShardId/$entityId"
286286
awaitAssert {
287287
system.actorSelection(replicationActorPath) ! GetStatus(entityId)
288-
expectMsg(Status(3))
288+
expectMsg(max = 1.second, Status(3))
289289
}
290290
}
291291
}

src/multi-jvm/scala/lerna/akka/entityreplication/raft/RaftActorMultiNodeSpec.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,6 @@ class RaftActorMultiNodeSpec extends MultiNodeSpec(RaftActorSpecConfig) with STM
654654

655655
protected def getState(raftActor: ActorRef): RaftState = {
656656
raftActor ! GetState
657-
expectMsgType[RaftState]
657+
expectMsgType[RaftState](max = 1.second)
658658
}
659659
}

0 commit comments

Comments
 (0)