alexliesenfeld / httpmock

HTTP mocking library for Rust
https://httpmock.rs
MIT License
472 stars 42 forks source link

Panicking on occasional PoisonError after delete() #53

Closed busyboredom closed 2 years ago

busyboredom commented 2 years ago

Relevant logs:

[2021-11-21T18:12:12Z DEBUG httpmock::server::web::handlers] Deleted mock with id=46
[2021-11-21T18:12:12Z DEBUG httpmock::server::web::handlers] Adding new mock with ID=48
[2021-11-21T18:12:12Z DEBUG httpmock::server::web::handlers] Deleted mock with id=45
[2021-11-21T18:12:12Z DEBUG httpmock::server::web::handlers] Adding new mock with ID=49
[2021-11-21T18:12:12Z DEBUG httpmock::server::web::handlers] Matched mock with id=45 to the following request: HttpMockRequest {

(request details omitted for brevity)

}
thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', /home/charlie/.cargo/registry/src/github.com-1ecc6299db9ec823/httpmock-0.6.4/src/server/web/handlers.rs:133:45
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: PoisonError { .. }', /home/charlie/.cargo/registry/src/github.com-1ecc6299db9ec823/httpmock-0.6.4/src/server/web/handlers.rs:115:40
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: PoisonError { .. }', /home/charlie/.cargo/registry/src/github.com-1ecc6299db9ec823/httpmock-0.6.4/src/server/web/handlers.rs:115:40

It doesn't happen often, maybe 1 in 10 times that I run my application's tests.

alexliesenfeld commented 2 years ago

Thanks for submitting this issue. The error should be fixed with e6282b8, which will be part of the next release.