ruby-changes:53939
From: normal <ko1@a...>
Date: Mon, 3 Dec 2018 18:34:54 +0900 (JST)
Subject: [ruby-changes:53939] normal:r66159 (trunk): spec/ruby/core/io/*_spec.rb: explain MJIT failures
normal 2018-12-03 18:34:49 +0900 (Mon, 03 Dec 2018) New Revision: 66159 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66159 Log: spec/ruby/core/io/*_spec.rb: explain MJIT failures These random failures happen because FD number allocation is not predictable when multiple threads are running (since MJIT thread is opening/closing files all the time). Real-world code practically never relies on predictable FD number allocation (because much real-world code is multi-threaded); so it's highly unlikely there'll be any breakage to the user. Modified files: trunk/spec/ruby/core/io/initialize_spec.rb trunk/spec/ruby/core/io/reopen_spec.rb Index: spec/ruby/core/io/initialize_spec.rb =================================================================== --- spec/ruby/core/io/initialize_spec.rb (revision 66158) +++ spec/ruby/core/io/initialize_spec.rb (revision 66159) @@ -13,9 +13,9 @@ describe "IO#initialize" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/io/initialize_spec.rb#L13 rm_r @name end - # http://ci.rvm.jp/results/trunk-mjit@silicon-docker/1469621 - # http://ci.rvm.jp/results/trunk-mjit@silicon-docker/1454818 - without_feature :mjit do # with RubyVM::MJIT.enabled?, this randomly fails for now + # File descriptor numbers are not predictable in multi-threaded code; + # MJIT will be opening/closing files the background + without_feature :mjit do it "reassociates the IO instance with the new descriptor when passed a Fixnum" do fd = new_fd @name, "r:utf-8" @io.send :initialize, fd, 'r' Index: spec/ruby/core/io/reopen_spec.rb =================================================================== --- spec/ruby/core/io/reopen_spec.rb (revision 66158) +++ spec/ruby/core/io/reopen_spec.rb (revision 66159) @@ -145,9 +145,9 @@ describe "IO#reopen with a String" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/io/reopen_spec.rb#L145 File.read(@other_name).should == "new data" end - # http://ci.rvm.jp/results/trunk-mjit@silicon-docker/1461550 - # http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/1448152 - without_feature :mjit do # with RubyVM::MJIT.enabled?, this randomly fails for now + # File descriptor numbers are not predictable in multi-threaded code; + # MJIT will be opening/closing files the background + without_feature :mjit do it "closes the file descriptor obtained by opening the new file" do @io = new_io @name, "w" -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/