Fix flaky TestSetTraceFunc#test_remove_in_trace by filtering trace events

This commit is contained in:
Naoto Ono 2024-08-13 19:37:47 +09:00 committed by Yusuke Endoh
parent abc04e898b
commit c06fbb192f
Notes: git 2024-08-16 00:47:36 +00:00

View File

@ -456,6 +456,9 @@ class TestSetTraceFunc < Test::Unit::TestCase
bug3921 = '[ruby-dev:42350]'
ok = false
func = lambda{|e, f, l, i, b, k|
# In parallel testing, unexpected events like IO operations may be traced,
# so we filter out events here.
next unless f == __FILE__
set_trace_func(nil)
ok = eval("self", b)
}