ruby-changes:35689
From: hsbt <ko1@a...>
Date: Fri, 3 Oct 2014 18:52:28 +0900 (JST)
Subject: [ruby-changes:35689] hsbt:r47771 (trunk): * test/ruby/test_io.rb (TestIO#test_advise): added workaround of fadvise(2)
hsbt 2014-10-03 18:52:21 +0900 (Fri, 03 Oct 2014) New Revision: 47771 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=47771 Log: * test/ruby/test_io.rb (TestIO#test_advise): added workaround of fadvise(2) with tmpfs and old linux kernel. [ruby-core:65355][Bug #10313] Modified files: trunk/ChangeLog trunk/test/ruby/test_io.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 47770) +++ ChangeLog (revision 47771) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Fri Oct 3 18:52:16 2014 SHIBATA Hiroshi <shibata.hiroshi@g...> + + * test/ruby/test_io.rb (TestIO#test_advise): added workaround of fadvise(2) + with tmpfs and old linux kernel. [ruby-core:65355][Bug #10313] + Fri Oct 3 18:22:45 2014 SHIBATA Hiroshi <shibata.hiroshi@g...> * .travis.yml: Disabled to generate document on travis. Index: test/ruby/test_io.rb =================================================================== --- test/ruby/test_io.rb (revision 47770) +++ test/ruby/test_io.rb (revision 47771) @@ -2486,7 +2486,15 @@ End https://github.com/ruby/ruby/blob/trunk/test/ruby/test_io.rb#L2486 [[0,0], [0, 20], [400, 2]].each do |offset, len| open(tf.path) do |t| ret = assert_nothing_raised(lambda { os_and_fs(tf.path) }) { - t.advise(adv, offset, len) + begin + t.advise(adv, offset, len) + rescue Errno::EINVAL + if /linux/ =~ RUBY_PLATFORM && (Etc.uname[:release].split('.').map(&:to_i) <=> [3,6]) < 0 + next # [ruby-core:65355] tmpfs is not supported + else + retry + end + end } assert_nil(ret) assert_raise(ArgumentError, "superfluous arguments") do -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/