LocalPubSubSpec: allow multiple debug messages (#30434)

* Fix MailboxSelectorSpec race

The comment already said there could be 2 dead letters, but the log
assertion failed when there was a second 'excess' one. Add a flag to
skip checking for excess log lines.

* LocalPubSubSpec: allow multiple debug messages

Fixes #30432 on top of #30429
This commit is contained in:
Arnout Engelen 2021-07-30 13:00:31 +02:00 committed by GitHub
parent 7faa33ff54
commit f3fb2a577d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -19,7 +19,7 @@ class LocalPubSubSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike wit
"publish to all local subscriber actors of a topic" in {
val fruitTopic =
LoggingTestKit.debug("Topic list updated").expect {
LoggingTestKit.debug("Topic list updated").withCheckExcess(false).expect {
testKit.spawn(Topic[String]("fruit"))
}
@ -50,9 +50,10 @@ class LocalPubSubSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike wit
}
"publish to all subscriber actors across several instances of the same topic" in {
val (fruitTopic1, fruitTopic2) = LoggingTestKit.debug("Topic list updated").withOccurrences(2).expect {
(testKit.spawn(Topic[String]("fruit")), testKit.spawn(Topic[String]("fruit")))
}
val (fruitTopic1, fruitTopic2) =
LoggingTestKit.debug("Topic list updated").withOccurrences(2).withCheckExcess(false).expect {
(testKit.spawn(Topic[String]("fruit")), testKit.spawn(Topic[String]("fruit")))
}
try {
val probe1 = testKit.createTestProbe[String]()
@ -126,7 +127,7 @@ class LocalPubSubSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike wit
"doesn't publish after unsubscribe" in {
val fruitTopic =
LoggingTestKit.debug("Topic list updated").expect {
LoggingTestKit.debug("Topic list updated").withCheckExcess(false).expect {
testKit.spawn(Topic[String]("fruit"))
}