You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "pjfanning (via GitHub)" <gi...@apache.org> on 2026/10/09 15:01:22 UTC
[PR] fix: allow overriding testKit in ScalaTestWithActorTestKit [pekko]
pjfanning opened a new pull request, #3610:
URL: https://github.com/apache/pekko/pull/3610
### Motivation
A spec that overrides `testKit` with a `val`, e.g. `override val testKit = ActorTestKit()`, fails with a `NullPointerException`. `ScalaTestWithActorTestKitBase.patience` is a strict `val` that reads `testKit.testKitSettings` while the trait is being initialized, before the subclass has assigned its overriding `testKit`.
### Modification
- Make `patience` a `lazy val`, so it is computed on first use, after construction.
- Add `ScalaTestWithActorTestKitSpec`.
### Result
Specs can override `testKit` with a `val`, and `patience` uses the overriding testkit's `DefaultTimeout`.
### Tests
- `actor-testkit-typed/Test/testOnly ...ScalaTestWithActorTestKitSpec` without the fix: failed with `NullPointerException` in `ScalaTestWithActorTestKitBase.testKit()`
- `actor-testkit-typed/Test/testOnly org.apache.pekko.actor.testkit.typed.scaladsl.*` with the fix: 99 passed on 2.13.18 and 3.3.8
- `actor-testkit-typed/mimaReportBinaryIssues` (baseline 1.0.0): passed on 2.13.18 and 3.3.8
- scalafmt run on changed files
### References
Fixes #1140
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] fix: allow overriding testKit in ScalaTestWithActorTestKit [pekko]
Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin merged PR #3610:
URL: https://github.com/apache/pekko/pull/3610
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org