test/test_backend.rb in polyphony-1.5 vs test/test_backend.rb in polyphony-1.6
- old
+ new
@@ -11,10 +11,11 @@
end
def teardown
@backend.finalize
Thread.current.backend = @prev_backend
+ super
end
def test_sleep
count = 0
t0 = monotonic_clock
@@ -129,11 +130,11 @@
@backend.post_fork
exit(42)
end
result = @backend.waitpid(pid)
- assert_equal [pid, 42], result
+ assert_equal [pid, 42 << 8], result
end
def test_read_loop
i, o = IO.pipe
@@ -351,10 +352,12 @@
o&.close
w&.close
end
def test_idle_gc
+ skip
+
GC.disable
count = GC.count
snooze
assert_equal count, GC.count
@@ -370,12 +373,13 @@
return unless IS_LINUX
# The idle tasks are ran at most once per fiber switch, before the backend
# is polled. Therefore, the second sleep will not have triggered a GC, since
# only 0.05s have passed since the gc period was set.
- sleep 0.07
+ sleep 0.05
assert_equal count, GC.count
+
# Upon the third sleep the GC should be triggered, at 0.12s post setting the
# GC period.
sleep 0.05
assert_equal count + 1, GC.count
@@ -438,9 +442,10 @@
end
def teardown
@backend.finalize
Thread.current.backend = @prev_backend
+ super
end
def test_simple_write_chain
i, o = IO.pipe