From 07a5db2c3223e5fa706c5b7040ca28e2bca44ca0 Mon Sep 17 00:00:00 2001 From: normal Date: Mon, 3 Dec 2018 09:34:49 +0000 Subject: 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66159 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- spec/ruby/core/io/initialize_spec.rb | 6 +++--- spec/ruby/core/io/reopen_spec.rb | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'spec') diff --git a/spec/ruby/core/io/initialize_spec.rb b/spec/ruby/core/io/initialize_spec.rb index b1b720f040..bc1f50e531 100644 --- a/spec/ruby/core/io/initialize_spec.rb +++ b/spec/ruby/core/io/initialize_spec.rb @@ -13,9 +13,9 @@ describe "IO#initialize" do 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' diff --git a/spec/ruby/core/io/reopen_spec.rb b/spec/ruby/core/io/reopen_spec.rb index 60dda72689..e769991554 100644 --- a/spec/ruby/core/io/reopen_spec.rb +++ b/spec/ruby/core/io/reopen_spec.rb @@ -145,9 +145,9 @@ describe "IO#reopen with a String" do 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" -- cgit v1.2.3