Created
July 7, 2013 21:40
-
-
Save luislavena/5945088 to your computer and use it in GitHub Desktop.
Test script for Bug #8594: https://bugs.ruby-lang.org/issues/8594
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def try | |
yield | |
print '.' | |
rescue Errno::EINVAL | |
print 'i' | |
sleep 1 | |
rescue Errno::ENOENT | |
print 'n' | |
sleep 1 | |
rescue Errno::EACCES | |
print 'a' | |
sleep 1 | |
rescue Errno::EBADF | |
print 'b' | |
sleep 1 | |
rescue Errno::ENETDOWN | |
print 'd' | |
sleep 1 | |
rescue Errno::ERANGE | |
print 'r' | |
sleep 1 | |
end | |
50.times do | |
filebase = 'shakeshake-' + Time.new.to_i.to_s | |
print "\ncreate " ; 50.times { |i| try { File.write('%s_%d' % [filebase, i], 'a' * 100_000) } } | |
print "\nrename " ; 50.times { |i| try { File.rename('%s_%d' % [filebase, i], 'deleteme_%d' % [i]) } } | |
print "\ndelete " ; 50.times { |i| try { File.unlink('deleteme_%d' % [i]) } } | |
puts | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment