mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
DEV: Fix randomly failing test.
Even if a thread is alive in the loop check, it may be dead by the time `Thread#wakeup` is called on it.
This commit is contained in:
parent
83f13ecf82
commit
adbc87857e
1 changed files with 8 additions and 1 deletions
|
@ -61,7 +61,14 @@ class SidekiqPauser
|
||||||
if t = @extend_lease_thread
|
if t = @extend_lease_thread
|
||||||
@extend_lease_thread = nil
|
@extend_lease_thread = nil
|
||||||
while t.alive?
|
while t.alive?
|
||||||
|
begin
|
||||||
t.wakeup
|
t.wakeup
|
||||||
|
rescue ThreadError => e
|
||||||
|
unless e.message =~ /killed thread/
|
||||||
|
raise e
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
sleep 0
|
sleep 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue