DEV: Add logging for flaky FinalDestination spec (#19548)
This test occasionally fails in CI. I haven't been able to reproduce the issue locally. This logging will print some extra information when the assertion fails.
This commit is contained in:
parent
2031b75055
commit
a56e679723
|
@ -17,13 +17,17 @@ describe FinalDestination::Resolver do
|
||||||
Addrinfo.stubs(:getaddrinfo).with { |addr| addr == "example.com" }.returns(mock_response)
|
Addrinfo.stubs(:getaddrinfo).with { |addr| addr == "example.com" }.returns(mock_response)
|
||||||
|
|
||||||
expect {
|
expect {
|
||||||
FinalDestination::Resolver.lookup("sleep.example.com", timeout: 0.001)
|
result = FinalDestination::Resolver.lookup("sleep.example.com", timeout: 0.001)
|
||||||
|
# If the test gets this far, it failed
|
||||||
|
puts "Flaky test debug: Result was #{result.inspect}"
|
||||||
}.to raise_error(Timeout::Error)
|
}.to raise_error(Timeout::Error)
|
||||||
|
|
||||||
start_thread_count = alive_thread_count
|
start_thread_count = alive_thread_count
|
||||||
|
|
||||||
expect {
|
expect {
|
||||||
FinalDestination::Resolver.lookup("sleep.example.com", timeout: 0.001)
|
result = FinalDestination::Resolver.lookup("sleep.example.com", timeout: 0.001)
|
||||||
|
# If the test gets this far, it failed
|
||||||
|
puts "Flaky test debug: Result was #{result.inspect}"
|
||||||
}.to raise_error(Timeout::Error)
|
}.to raise_error(Timeout::Error)
|
||||||
|
|
||||||
expect(alive_thread_count).to eq(start_thread_count)
|
expect(alive_thread_count).to eq(start_thread_count)
|
||||||
|
|
Loading…
Reference in New Issue