diff options
| author | Koichi Sasada <ko1@atdot.net> | 2026-06-12 08:08:49 +0000 |
|---|---|---|
| committer | Koichi Sasada <ko1@atdot.net> | 2026-06-12 17:50:47 +0900 |
| commit | 2bfacb56c5991cdc040f82cc8ee89a5b2ad351cb (patch) | |
| tree | c1d2d86bd049504b9aee446c77f5a7422753aedf /doc/tutorial/short_names.rb | |
| parent | 0f211465887a601a9a1eb1b8d4f5174c852b4939 (diff) | |
In parallel test-all, a worker process may hold garbage Tempfile
objects left by previously run test files. When GC is triggered while
a TracePoint of this test is enabled, their finalizers
(Tempfile::FinalizerManager#call) run on the main thread at an
interrupt checkpoint, so the target_thread? guard cannot reject their
events and the test fails like:
TestSetTraceFunc#test_tracepoint_callee_id:
<[:c_return, :each_char, :each]> expected but was
<[:c_return, :delete, :delete]>. # Hash#delete in the finalizer
Reject such events by looking at caller_locations: an event is ours
iff the innermost frame, ignoring core methods written in Ruby
(<internal:*> such as Kernel#tap), belongs to this file. Finalizer
frames are pushed on top of the interrupted frame of this file, so
their events are rejected even when a finalizer calls core methods
written in Ruby.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Diffstat (limited to 'doc/tutorial/short_names.rb')
0 files changed, 0 insertions, 0 deletions
