[前][次][番号順一覧][スレッド一覧]

ruby-changes:62861

From: nagachika <ko1@a...>
Date: Mon, 7 Sep 2020 21:14:20 +0900 (JST)
Subject: [ruby-changes:62861] 277076173a (ruby_2_7): Run a TracePoint test in an insolated process

https://git.ruby-lang.org/ruby.git/commit/?id=277076173a

From 277076173af868d297070da43fcb3a06ccb7e21f Mon Sep 17 00:00:00 2001
From: nagachika <nagachika@r...>
Date: Mon, 7 Sep 2020 21:13:43 +0900
Subject: Run a TracePoint test in an insolated process

to prevent a random failure like
http://ci.rvm.jp/results/trunk-random2@phosphorus-docker/3024287

diff --git a/test/ruby/test_settracefunc.rb b/test/ruby/test_settracefunc.rb
index e9e22ae..e16a4fc 100644
--- a/test/ruby/test_settracefunc.rb
+++ b/test/ruby/test_settracefunc.rb
@@ -2282,15 +2282,17 @@ class TestSetTraceFunc < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_settracefunc.rb#L2282
 
   def test_tracepoint_opt_invokebuiltin_delegate_leave
     code = 'puts RubyVM::InstructionSequence.of("\x00".method(:unpack)).disasm'
-    out, _err, _status = EnvUtil.invoke_ruby(['-e', code], '', true)
+    out = EnvUtil.invoke_ruby(['-e', code], '', true).first
     assert_match /^0000 opt_invokebuiltin_delegate_leave /, out
 
-    events = []
-    TracePoint.new(:return) do |tp|
-      events << [tp.event, tp.method_id]
-    end.enable do
-      "\x00".unpack("c")
-    end
-    assert_equal [[:return, :unpack]], events
+    event = eval(EnvUtil.invoke_ruby(['-e', <<~'EOS'], '', true).first)
+      set_trace_func(proc {}); set_trace_func(nil) # Is it okay that this is required?
+      TracePoint.new(:return) do |tp|
+        p [tp.event, tp.method_id]
+      end.enable do
+        "\x00".unpack("c")
+      end
+    EOS
+    assert_equal [:return, :unpack], event
   end
 end
diff --git a/version.h b/version.h
index 16b61b3..7f37a34 100644
--- a/version.h
+++ b/version.h
@@ -2,7 +2,7 @@ https://github.com/ruby/ruby/blob/trunk/version.h#L2
 # define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR
 #define RUBY_VERSION_TEENY 1
 #define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
-#define RUBY_PATCHLEVEL 122
+#define RUBY_PATCHLEVEL 123
 
 #define RUBY_RELEASE_YEAR 2020
 #define RUBY_RELEASE_MONTH 9
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]