Skip to content

Commit 9d70118

Browse files
committed
merge revision(s) 41254,41655: [Backport ruby#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 ruby#8519] * test/ruby/test_io.rb (TestIO#test_write_32bit_boundary): skip if writing a file is slow. [ruby-core:55541] [Bug ruby#8519] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@41659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 3da1f24 commit 9d70118

File tree

3 files changed

+43
-13
lines changed

3 files changed

+43
-13
lines changed

ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
Wed Jun 26 23:05:34 2013 Hiroshi Shirosaki <[email protected]>
2+
3+
* test/ruby/test_io.rb (TestIO#test_write_32bit_boundary): skip if
4+
writing a file is slow.
5+
[ruby-core:55541] [Bug #8519]
6+
17
Wed Jun 26 22:42:36 2013 Nobuyoshi Nakada <[email protected]>
28

39
* lib/mkmf.rb: should use expanded values for header directories

test/ruby/test_io.rb

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2671,19 +2671,43 @@ def test_read_32bit_boundary
26712671
def test_write_32bit_boundary
26722672
bug8431 = '[ruby-core:55098] [Bug #8431]'
26732673
make_tempfile {|t|
2674-
assert_separately(["-", bug8431, t.path], <<-"end;", timeout: 30)
2675-
msg = ARGV.shift
2676-
f = open(ARGV[0], "wb")
2677-
f.seek(0xffff_ffff)
2678-
begin
2679-
# this will consume very long time or fail by ENOSPC on a
2680-
# filesystem which sparse file is not supported
2681-
f.write('1')
2682-
rescue SystemCallError
2683-
else
2684-
assert_equal(0x1_0000_0000, f.tell, msg)
2674+
def t.close(unlink_now = false)
2675+
# TODO: Tempfile should deal with this delay on Windows?
2676+
# NOTE: re-opening with O_TEMPORARY does not work.
2677+
path = self.path
2678+
ret = super
2679+
if unlink_now
2680+
begin
2681+
File.unlink(path)
2682+
rescue Errno::ENOENT
2683+
rescue Errno::EACCES
2684+
sleep(2)
2685+
retry
2686+
end
26852687
end
2686-
end;
2688+
ret
2689+
end
2690+
2691+
begin
2692+
assert_separately(["-", bug8431, t.path], <<-"end;", timeout: 30)
2693+
msg = ARGV.shift
2694+
f = open(ARGV[0], "wb")
2695+
f.seek(0xffff_ffff)
2696+
begin
2697+
# this will consume very long time or fail by ENOSPC on a
2698+
# filesystem which sparse file is not supported
2699+
f.write('1')
2700+
pos = f.tell
2701+
rescue Errno::ENOSPC
2702+
skip "non-sparse file system"
2703+
rescue SystemCallError
2704+
else
2705+
assert_equal(0x1_0000_0000, pos, msg)
2706+
end
2707+
end;
2708+
rescue Timeout::Error
2709+
skip "Timeout because of slow file writing"
2710+
end
26872711
}
26882712
end if /mswin|mingw/ =~ RUBY_PLATFORM
26892713
end

version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#define RUBY_VERSION "2.0.0"
22
#define RUBY_RELEASE_DATE "2013-06-26"
3-
#define RUBY_PATCHLEVEL 243
3+
#define RUBY_PATCHLEVEL 244
44

55
#define RUBY_RELEASE_YEAR 2013
66
#define RUBY_RELEASE_MONTH 6

0 commit comments

Comments
 (0)