1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/spec/ruby/core/io
normal 332b302f92 spec/ruby/core/io/select_spec.rb: workaround stuck IO.select
Under pipe page memory pressure on Linux, a pipe may only be
created with a single buffer[1].  And as of Linux v4.18, the
fs/pipe.c::pipe_poll callback does not account for merging
done in fs/pipe::pipe_write; only the number of usable buffers
in the pipe.  Thus it is possible for a pipe to be writable
(if only by a small amount) despite IO.select saying it is not.

With the default 16384 /proc/sys/fs/pipe-user-pages-soft value
and the pipe having 16 pages of buffers, this issue is trivially
reproducible by creating 1024 pipes in a background process
before running the spec:

  $ ulimit -n 2053 # or something higher
  $ ./miniruby -e '1024.times.map { IO.pipe }; sleep' &
  $ make test-spec MSPECOPT=spec/ruby/core/io/select_spec.rb

So, we create a new pipe we never write to for testing
writability of IO.select.  This may cause the test to fail with
ENFILE on an overloaded system, but at least that's an obvious
failure (unlike having a test get stuck).  This should reduce
failures on our overloaded CI machines:

   http://ci.rvm.jp/results/trunk-nopara@silicon-docker/1239426

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/pipe.c?h=v4.18#n642

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-20 01:43:10 +00:00
..
fixtures
shared Update to ruby/spec@9be7c7e 2018-08-03 16:19:40 +00:00
advise_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
binmode_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
binread_spec.rb Update to ruby/spec@6f38a82 2018-04-28 19:50:06 +00:00
binwrite_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
bytes_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
chars_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
close_on_exec_spec.rb Update to ruby/spec@6f38a82 2018-04-28 19:50:06 +00:00
close_read_spec.rb Update to ruby/spec@6f38a82 2018-04-28 19:50:06 +00:00
close_spec.rb Update to ruby/spec@6f38a82 2018-04-28 19:50:06 +00:00
close_write_spec.rb Update to ruby/spec@6f38a82 2018-04-28 19:50:06 +00:00
closed_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
codepoints_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
constants_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
copy_stream_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
dup_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
each_byte_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
each_char_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
each_codepoint_spec.rb Update to ruby/spec@6f38a82 2018-04-28 19:50:06 +00:00
each_line_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
each_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
eof_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
external_encoding_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
fcntl_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
fdatasync_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
fileno_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
flush_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
for_fd_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
foreach_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
fsync_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
getbyte_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
getc_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
gets_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
initialize_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
inspect_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
internal_encoding_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
io_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
ioctl_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
isatty_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
lineno_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
lines_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
new_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
open_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
output_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
pid_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
pipe_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
popen_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
pos_spec.rb Update to ruby/spec@a454137 2018-06-27 12:30:05 +00:00
print_spec.rb Update to ruby/spec@a454137 2018-06-27 12:30:05 +00:00
printf_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
putc_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
puts_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
read_nonblock_spec.rb Update to ruby/spec@6f38a82 2018-04-28 19:50:06 +00:00
read_spec.rb Update to ruby/spec@9be7c7e 2018-08-03 16:19:40 +00:00
readbyte_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
readchar_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
readline_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
readlines_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
readpartial_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
reopen_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
rewind_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
seek_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
select_spec.rb spec/ruby/core/io/select_spec.rb: workaround stuck IO.select 2018-08-20 01:43:10 +00:00
set_encoding_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
stat_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
sync_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
sysopen_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
sysread_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
sysseek_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
syswrite_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
tell_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
to_i_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
to_io_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
try_convert_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
tty_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
ungetbyte_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
ungetc_spec.rb Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
write_nonblock_spec.rb Update to ruby/spec@6f38a82 2018-04-28 19:50:06 +00:00
write_spec.rb Update to ruby/spec@4bb0f25 2018-06-13 21:58:54 +00:00