Unverified Commit 2e8a0c08 authored by Igor Matuszewski's avatar Igor Matuszewski Committed by GitHub
Browse files

Fix some flaky offchain HTTP tests (#6038)

* http: Use assert_eq in tests for better debuggability

* http: Use matches! macro instead of if let ...

* http: Simplify some bits and pieces

* http: Don't answer immediately in HTTP test server

Sometimes it can happen that we receive the response immediately
when testing the HTTP api due to kernel scheduling. Because of it, we
add a marginal 10ms async-friendly delay to minimize the risk.

* http: Use the same async runtime when testing HTTP API/worker

* http: Return a future Delay only for non-zero Duration

This allows to short-circuit in the response_wait logic and only
send/not wait for response.
parent f822521a
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment