Skip to content

Tests stability: Control time explicitly in async tests using test-util feature from tokio #2602

Description

@AmmarAbouZor

We have currently many async tests which are related to advancing time (like spawning TCP/UDP servers and send data periodically or cancel safety testing, etc...)

The current solution is to call tokio::sleep for actual period of times making tests take more time and not reliable as they should be.

Tokio provides the feature test-util which allows controlling time for test scenarios example link

We need to scan our tests and use this feature for all cases where applicable.

Also it would be great if those changes can avoid forcing running async tests in with multiple threads on all operating systems

Metadata

Metadata

Assignees

Labels

newnewly created issue

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions