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
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
..
argf Update to ruby/spec@6f38a82 2018-04-28 19:50:06 +00:00
array Update to ruby/spec@9be7c7e 2018-08-03 16:19:40 +00:00
basicobject Update to ruby/spec@4bb0f25 2018-06-13 21:58:54 +00:00
binding Update to ruby/spec@9be7c7e 2018-08-03 16:19:40 +00:00
builtin_constants Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
class Update to ruby/spec@a454137 2018-06-27 12:30:05 +00:00
comparable Update to ruby/spec@6f38a82 2018-04-28 19:50:06 +00:00
complex Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
dir Update to ruby/spec@6f38a82 2018-04-28 19:50:06 +00:00
encoding Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
enumerable Update to ruby/spec@9be7c7e 2018-08-03 16:19:40 +00:00
enumerator Update to ruby/spec@6f38a82 2018-04-28 19:50:06 +00:00
env Update to ruby/spec@a454137 2018-06-27 12:30:05 +00:00
exception Update to ruby/spec@a454137 2018-06-27 12:30:05 +00:00
false Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
fiber Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
file Update to ruby/spec@4bb0f25 2018-06-13 21:58:54 +00:00
filetest Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
float Update to ruby/spec@a454137 2018-06-27 12:30:05 +00:00
gc Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
hash Update to ruby/spec@a454137 2018-06-27 12:30:05 +00:00
integer Update to ruby/spec@a454137 2018-06-27 12:30:05 +00:00
io spec/ruby/core/io/select_spec.rb: workaround stuck IO.select 2018-08-20 01:43:10 +00:00
kernel Update to ruby/spec@9be7c7e 2018-08-03 16:19:40 +00:00
main Update to ruby/spec@6f38a82 2018-04-28 19:50:06 +00:00
marshal Update to ruby/spec@4bb0f25 2018-06-13 21:58:54 +00:00
matchdata Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
math Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
method use requrie_relative 2018-03-31 11:11:31 +00:00
module Update to ruby/spec@9be7c7e 2018-08-03 16:19:40 +00:00
mutex Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
nil Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
numeric Add version guards for Enumerator::ArithmeticSequence 2018-08-17 11:22:30 +00:00
objectspace Update to ruby/spec@6f38a82 2018-04-28 19:50:06 +00:00
proc required paths are real paths 2018-03-05 01:57:27 +00:00
process Always set autoclose=false for IO.for_fd fds 2018-08-18 19:35:20 +00:00
random Update to ruby/spec@6f38a82 2018-04-28 19:50:06 +00:00
range Add version guards for Enumerator::ArithmeticSequence 2018-08-17 11:22:30 +00:00
rational Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
regexp Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
signal Add colon to avoid chkbuild's alert 2018-08-08 13:44:25 +00:00
string Update to ruby/spec@9be7c7e 2018-08-03 16:19:40 +00:00
struct Update to ruby/spec@6f38a82 2018-04-28 19:50:06 +00:00
symbol Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
systemexit Update to ruby/spec@a454137 2018-06-27 12:30:05 +00:00
thread Update to ruby/spec@9be7c7e 2018-08-03 16:19:40 +00:00
threadgroup Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
time Update to ruby/spec@9be7c7e 2018-08-03 16:19:40 +00:00
tracepoint Update to ruby/spec@a454137 2018-06-27 12:30:05 +00:00
true Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00
unboundmethod required paths are real paths 2018-03-05 01:57:27 +00:00
warning Update to ruby/spec@c1b568b 2018-03-04 15:09:32 +00:00