Extend the timeout of Fiddle::TestFunction#test_nogvl_poll
This commit is contained in:
parent
3a323c6b12
commit
ace17ba3cd
@ -180,13 +180,13 @@ module Fiddle
|
|||||||
end
|
end
|
||||||
f = Function.new(poll, [TYPE_VOIDP, TYPE_INT, TYPE_INT], TYPE_INT)
|
f = Function.new(poll, [TYPE_VOIDP, TYPE_INT, TYPE_INT], TYPE_INT)
|
||||||
|
|
||||||
msec = 200
|
msec = EnvUtil.apply_timeout_scale(1000)
|
||||||
t0 = Process.clock_gettime(Process::CLOCK_MONOTONIC, :millisecond)
|
t0 = Process.clock_gettime(Process::CLOCK_MONOTONIC, :millisecond)
|
||||||
th = Thread.new { f.call(nil, 0, msec) }
|
th = Thread.new { f.call(nil, 0, msec) }
|
||||||
n1 = f.call(nil, 0, msec)
|
n1 = f.call(nil, 0, msec)
|
||||||
n2 = th.value
|
n2 = th.value
|
||||||
t1 = Process.clock_gettime(Process::CLOCK_MONOTONIC, :millisecond)
|
t1 = Process.clock_gettime(Process::CLOCK_MONOTONIC, :millisecond)
|
||||||
assert_in_delta(msec, t1 - t0, 180, 'slept amount of time')
|
assert_in_delta(msec, t1 - t0, EnvUtil.apply_timeout_scale(500), 'slept amount of time')
|
||||||
assert_equal(0, n1, perror("poll(2) in main-thread"))
|
assert_equal(0, n1, perror("poll(2) in main-thread"))
|
||||||
assert_equal(0, n2, perror("poll(2) in sub-thread"))
|
assert_equal(0, n2, perror("poll(2) in sub-thread"))
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user