mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
add more diagnostics for flaky spec
This commit is contained in:
@ -61,7 +61,7 @@ module Helpers
|
||||
Guardian.stubs(new: guardian).with(user)
|
||||
end
|
||||
|
||||
def wait_for(&blk)
|
||||
def wait_for(on_fail: nil, &blk)
|
||||
i = 0
|
||||
result = false
|
||||
while !result && i < 1000
|
||||
@ -70,6 +70,7 @@ module Helpers
|
||||
sleep 0.001
|
||||
end
|
||||
|
||||
on_fail&.call
|
||||
expect(result).to eq(true)
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user