Skip to content

Commit 174ddc7

Browse files
committed
Skip File.atime/File.mtime tests randomly failing on Travis
Not only powerpc64le, also s390x and arm32 seem failing too. These failures are probably caused by filesystem settings on Travis, but unrelated to CPUs.
1 parent c3e37f7 commit 174ddc7

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

spec/ruby/core/file/atime_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
end
1717

1818
platform_is :linux, :windows do
19-
platform_is_not :"powerpc64le-linux" do # https://bugs.ruby-lang.org/issues/17926
19+
unless ENV.key?('TRAVIS') # https://bugs.ruby-lang.org/issues/17926
2020
## NOTE also that some Linux systems disable atime (e.g. via mount params) for better filesystem speed.
2121
it "returns the last access time for the named file with microseconds" do
2222
supports_subseconds = Integer(`stat -c%x '#{__FILE__}'`[/\.(\d{1,6})/, 1], 10)

spec/ruby/core/file/mtime_spec.rb

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,16 @@
1616
end
1717

1818
platform_is :linux, :windows do
19-
it "returns the modification Time of the file with microseconds" do
20-
supports_subseconds = Integer(`stat -c%y '#{__FILE__}'`[/\.(\d{1,6})/, 1], 10)
21-
if supports_subseconds != 0
22-
expected_time = Time.at(Time.now.to_i + 0.123456)
23-
File.utime 0, expected_time, @filename
24-
File.mtime(@filename).usec.should == expected_time.usec
25-
else
26-
File.mtime(__FILE__).usec.should == 0
19+
unless ENV.key?('TRAVIS') # https://bugs.ruby-lang.org/issues/17926
20+
it "returns the modification Time of the file with microseconds" do
21+
supports_subseconds = Integer(`stat -c%y '#{__FILE__}'`[/\.(\d{1,6})/, 1], 10)
22+
if supports_subseconds != 0
23+
expected_time = Time.at(Time.now.to_i + 0.123456)
24+
File.utime 0, expected_time, @filename
25+
File.mtime(@filename).usec.should == expected_time.usec
26+
else
27+
File.mtime(__FILE__).usec.should == 0
28+
end
2729
end
2830
end
2931
end

0 commit comments

Comments
 (0)