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

ruby-changes:48800

From: ko1 <ko1@a...>
Date: Mon, 27 Nov 2017 11:11:41 +0900 (JST)
Subject: [ruby-changes:48800] ko1:r60916 (trunk): Ignore failures related to threading.

ko1	2017-11-27 11:11:36 +0900 (Mon, 27 Nov 2017)

  New Revision: 60916

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60916

  Log:
    Ignore failures related to threading.
    
    * test/lib/tracepointchecker.rb: ignore "deletion trace" check
      when there are threads other than the main thread.

  Modified files:
    trunk/test/lib/tracepointchecker.rb
Index: test/lib/tracepointchecker.rb
===================================================================
--- test/lib/tracepointchecker.rb	(revision 60915)
+++ test/lib/tracepointchecker.rb	(revision 60916)
@@ -6,9 +6,16 @@ module TracePointChecker https://github.com/ruby/ruby/blob/trunk/test/lib/tracepointchecker.rb#L6
   }
 
   module ZombieTraceHunter
-    def before_setup
-      @tracepoint_captured_stat = TracePoint.stat.map{|k, (activated, deleted)| [k, activated, deleted]}
+    def tracepoint_capture_stat_get
+      TracePoint.stat.map{|k, (activated, deleted)|
+        deleted = 0 unless @tracepoint_captured_singlethread
+        [k, activated, deleted]
+      }
+    end
 
+    def before_setup
+      @tracepoint_captured_singlethread = (Thread.list.size == 1)
+      @tracepoint_captured_stat = tracepoint_capture_stat_get()
       super
     end
 
@@ -18,7 +25,7 @@ module TracePointChecker https://github.com/ruby/ruby/blob/trunk/test/lib/tracepointchecker.rb#L25
       # detect zombie traces.
       assert_equal(
         @tracepoint_captured_stat,
-        TracePoint.stat.map{|k, (activated, deleted)| [k, activated, deleted]},
+        tracepoint_capture_stat_get(),
         "The number of active/deleted trace events was changed"
       )
       # puts "TracePoint - deleted: #{deleted}" if deleted > 0

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

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