mockito: Shutdown race condition

Description

It seems that mockito has a race condition during shutdowns in async environments with many tests. This is a new issue in version 0.32.

Reproducer

I wasn’t able to find a minimal version. However here is a public version:

https://github.com/influxdata/influxdb_iox/pull/6966/commits/c31bb4d7a55936b6e4ae1b33491f0047992a6d78

Run:

$ RUST_BACKTRACE=1 RUST_LOG=debug LOG_FILTER=debug cargo test -p influxdb2_client -- --nocapture
...
2023-02-13T14:20:25.722030Z ERROR hyper::server::tcp: accept error: A Tokio 1.x context was found, but it is being shutdown.
...

The same error repeats multiple times and many tests never finish.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

Fixed, thanks! 😃

@crepererum @demoray @ogarcia please give 0.32.3 a try - it should address your issues.

@crepererum that worked and I managed to reproduce the issue.

This PR updates the test to 0.32.0, including the forget to preclude the Mock::drop calls. https://github.com/Azure/azure-sdk-for-rust/pull/1212

If you want to run just this unit test, check out the repo and run the following:

cargo test --all -p azure_iot_deviceupdate can_import_update

@crepererum can you try running it with this commit?