summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-26 14:07:48 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-26 14:07:48 +0000
commit9d701183e159b9f3c4a4a54fbba9fae2af3a9be6 (patch)
tree749524a0f9d8f583719e8f26b30f54a0aa74b8ab
parent3da1f24e1e02fbbdd32305299d871a34fe3d54c8 (diff)
merge revision(s) 41254,41655: [Backport #8519]
test_io.rb: fix test error * test/ruby/test_io.rb (TestIO#test_write_32bit_boundary): retry to remove the temporary file while EACCES occurs because of syncing in the system probably. rescue ENOSPC from IO#tell. [ruby-core:55457] [Bug #8519] * test/ruby/test_io.rb (TestIO#test_write_32bit_boundary): skip if writing a file is slow. [ruby-core:55541] [Bug #8519] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@41659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--test/ruby/test_io.rb48
-rw-r--r--version.h2
3 files changed, 43 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index 1e7790a4dc..a9ad3d4d8f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Wed Jun 26 23:05:34 2013 Hiroshi Shirosaki <h.shirosaki@gmail.com>
+
+ * test/ruby/test_io.rb (TestIO#test_write_32bit_boundary): skip if
+ writing a file is slow.
+ [ruby-core:55541] [Bug #8519]
+
Wed Jun 26 22:42:36 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb: should use expanded values for header directories
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index d10926d2c9..9637215509 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -2671,19 +2671,43 @@ End
def test_write_32bit_boundary
bug8431 = '[ruby-core:55098] [Bug #8431]'
make_tempfile {|t|
- assert_separately(["-", bug8431, t.path], <<-"end;", timeout: 30)
- msg = ARGV.shift
- f = open(ARGV[0], "wb")
- f.seek(0xffff_ffff)
- begin
- # this will consume very long time or fail by ENOSPC on a
- # filesystem which sparse file is not supported
- f.write('1')
- rescue SystemCallError
- else
- assert_equal(0x1_0000_0000, f.tell, msg)
+ def t.close(unlink_now = false)
+ # TODO: Tempfile should deal with this delay on Windows?
+ # NOTE: re-opening with O_TEMPORARY does not work.
+ path = self.path
+ ret = super
+ if unlink_now
+ begin
+ File.unlink(path)
+ rescue Errno::ENOENT
+ rescue Errno::EACCES
+ sleep(2)
+ retry
+ end
end
- end;
+ ret
+ end
+
+ begin
+ assert_separately(["-", bug8431, t.path], <<-"end;", timeout: 30)
+ msg = ARGV.shift
+ f = open(ARGV[0], "wb")
+ f.seek(0xffff_ffff)
+ begin
+ # this will consume very long time or fail by ENOSPC on a
+ # filesystem which sparse file is not supported
+ f.write('1')
+ pos = f.tell
+ rescue Errno::ENOSPC
+ skip "non-sparse file system"
+ rescue SystemCallError
+ else
+ assert_equal(0x1_0000_0000, pos, msg)
+ end
+ end;
+ rescue Timeout::Error
+ skip "Timeout because of slow file writing"
+ end
}
end if /mswin|mingw/ =~ RUBY_PLATFORM
end
diff --git a/version.h b/version.h
index 01241ec964..9d076507cd 100644
--- a/version.h
+++ b/version.h
@@ -1,6 +1,6 @@
#define RUBY_VERSION "2.0.0"
#define RUBY_RELEASE_DATE "2013-06-26"
-#define RUBY_PATCHLEVEL 243
+#define RUBY_PATCHLEVEL 244
#define RUBY_RELEASE_YEAR 2013
#define RUBY_RELEASE_MONTH 6