Skip to content

Bug: Akka.TestKit Within and ExpectNoMsg can't be used together #2130

@Aaronontheweb

Description

@Aaronontheweb

Found this bug while working on #2121 (comment)

A TestKit code block written like this:

Within(TimeSpan.FromSeconds(10), () => {
 // other stuff
ExpectNoMsg();
});

ExpectNoMsg() will wait until the defined timespan inside Within is hit, which causes the Within block to report that it executed longer than expected.

Therefore we should use an epsilon value to allow the Within block to check for a slightly longer time than reported by its configured timespan - so Within's check should check for 10.01 seconds in this case instead of exactly 10:00, which will fail because ExpectNoMsg waits until exactly 10:00.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions