summaryrefslogtreecommitdiff
path: root/spec
AgeCommit message (Collapse)Author
2018-08-20spec/ruby/core/io/select_spec.rb: workaround stuck IO.selectnormal
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-19don't run specs add at r64409 on Windowsnaruse
Maybe it breaks http://mswinci.japaneast.cloudapp.azure.com/vc12-x64/ruby-trunk/log/20180817T095734Z.fail.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64471 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-19select() on all platforms for Socket#recvmsg_nonblock speceregon
* The specs above already do that, and Solaris needs it too: https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable10x/ruby-trunk/log/20180819T111806Z.fail.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64470 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-18Guard spec which only works on Linuxeregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-18Special case for Solaris 11x on RubyCIeregon
* Where localhost is an alias but not the primary name of 127.0.0.1. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64463 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-18Be more flexible in the protocol value returned by getaddrinfo()eregon
* Only Solaris 2.10 i386 and Windows seem to return 0 it and other Solaris seem to fill the value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-18Adapt pack_sockaddr_in specs for Solariseregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64461 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-18Use ftp for the service in getaddrinfo/getnameinfo/getservbyname specseregon
* Solaris cannot resolve 'http' but can resolve 'ftp'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-18Simplify to a more standardized Socket SCM constant in specseregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-18Add guards for Solaris for socket specseregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-18Adapt spec to consider Solariseregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-18Use 127.0.0.1 instead of localhost in Addrinfo specseregon
* Solaries doesn't support Addrinfo.getaddrinfo('localhost', 80), but supports Addrinfo.getaddrinfo('127.0.0.1', 80). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64456 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-18Accept TypeError for Socket#getnameinfoeregon
* Happens when VALIDATE_SOCKLEN() actually checks the length such as on FreeBSD. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-18Always set autoclose=false for IO.for_fd fdseregon
* I believe this should be default behavior, see [Feature #2250]. * Now make test-spec MSPECOPT='-R100 spec/ruby/library/socket' works fine. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-18Re-add socket specseregon
* This reverts commit df9521fd043df1fb862e46f9b1af83223f16eb2d: "Remove failing spec files" * Platform guards follow in the next commits. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-18Revert r64441eregon
* This reverts commit 647fc1227a4146ecbfeb0d59358abc8d99cd8ae6: "thread_sync.c (rb_mutex_synchronize): only unlock if we own the mutex" * Let's try to preserve the semantics of always being locked inside Mutex#synchronize, even if an exception interrupts ConditionVariable#wait. * As discussed on [Bug #14999]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-18thread_sync.c (rb_mutex_synchronize): only unlock if we own the mutexnormal
If an exception is raised inside Mutex#sleep (via ConditionVariable#wait), we cannot guarantee we can own the mutex in the ensure callback. However, who owns the mutex at that point does not matter. What matters is the Mutex is usable after an exception occurs. * thread_sync.c (rb_mutex_synchronize): only unlock if we own the mutex * spec/ruby/library/conditionvariable/wait_spec.rb: only test lock usability after thread kill. Who owns the lock at any particular moment is an implementation detail which we cannot easily guarantee. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-17Guard spec failing on Solariseregon
* https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11x/ruby-trunk/log/20180817T182406Z.fail.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-17Add guard for Solaris in Socket#connect_nonblock speceregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-17Guard connect_nonblock spec on FreeBSDeregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-17Guard with a :pktinfo feature specs relying on PKTINFOeregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-17Re-add specseregon
* This reverts commit 325fd389018897bd156837639675517ef3b7dea5. * Platform guards in the next commit. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64414 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-17Add a note how to run specs under older Ruby versionseregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-17Fix typo in version guarderegon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-17Add version guards for Enumerator::ArithmeticSequenceeregon
* And keep specs for older versions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-17spec/README.md: add a note about version guardseregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-17Integrate new specs for ConditionVariable#wait to prevent regressionseregon
* See [Bug #14999]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-16skip examples failing on solarisnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64393 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-16apply r64239 to macOS toonobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-15spec/ruby/optional/capi/ext/io_spec.c: guard unreachable codenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-15spec/ruby/optional/capi/ext/io_spec.c: guard unreachable codenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64378 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-15-Wsuggest-attribute=noreturn on io_spec_rb_io_wait_readablenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-14spec/ruby/optional/capi/io_spec.rb: fix fragile spec from unpredictable errnonormal
rb_io_wait_readable and rb_io_wait_writable depend on the TSD errno value. Due to the recent changes in r64352-r64353 to restructure GVL, errno could be set to EAGAIN from the signal self-pipe and cause the rb_io_wait_readable spec to block unexpectedly. This should fix rubyspec timeouts on Solaris: http://rubyci.s3.amazonaws.com/unstable11s/ruby-trunk/log/20180814T042506Z.fail.html.gz * spec/ruby/optional/capi/ext/io_spec.c: add errno= setter method * spec/ruby/optional/capi/io_spec.rb: set errno to appropriate values for tests git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-14non-symbol keys in kwargsnobu
* class.c (separate_symbol): [EXPERIMENTAL] non-symbol key in keyword arguments hash causes an exception now. c.f. https://twitter.com/yukihiro_matz/status/1022287578995646464 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64358 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-12skip non-IP interfacesnobu
* spec/ruby/library/socket/socket/getifaddrs_spec.rb: VirtualBox host only adapter seems something different than ordinary interfaces. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64313 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-11fix r64296naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64309 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-11Solaris 10 doesn't have getifaddrsnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64297 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-11Solaris raises EAI_SERVICE if hints.ai_socktype=0naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-10Remove failing specsnaruse
https://rubyci.org/logs/rubyci.s3.amazonaws.com/freebsd11zfs/ruby-trunk/log/20180810T183001Z.fail.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-10Remove failing spec filesnaruse
Re-commit after specs are fixed. http://rubyci.s3.amazonaws.com/freebsd11zfs/ruby-trunk/log/20180810T063001Z.log.html.gz http://rubyci.s3.amazonaws.com/unstable10x/ruby-trunk/log/20180809T191808Z.log.html.gz http://rubyci.s3.amazonaws.com/unstable11x/ruby-trunk/log/20180809T192406Z.log.html.gz http://rubyci.s3.amazonaws.com/unstable10s/ruby-trunk/log/20180809T151911Z.log.html.gz http://rubyci.s3.amazonaws.com/unstable11s/ruby-trunk/log/20180809T192507Z.log.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-10process.c: fix rubyspec of Process.groupsmrkn
getgroups(2) may return a GID list that includes duplicated GIDs. The behavior is totaly depends on what OS is used. This commit fixes the example of Process.groups so that the example is independent of this OS-dependent features. Additonaly, this commit adds the description of such system-dependent characteristics of Process.groups. [ruby-dev:50603] [Bug #14969] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-10another test needs IO.selectnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64258 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-09Don't run the spec on Solarisnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-09apply r64239 to macOS toonobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-09apply r64239 to macOS toonobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64241 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-09Don't run specs on Solarisnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-09spec/ruby/library/socket/*: more FreeBSD fixesnormal
FreeBSD portability notes: Loopback connections are not instantaneous (unlike Linux), so non-blocking read-after-write MUST check for readability via IO.select or IO#wait_readable before attempting non-blocking recv/read operations. IPv6 seems favored, so we'll get "::" instead of "0.0.0.0" Some constants are different or obsolete, so that should be self-explanatory. There are still other failures I or somebody else needs to get to when we have time and feel like dealing with spec DSL: http://rubyci.s3.amazonaws.com/freebsd11zfs/ruby-trunk/recent.html git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-08fix MSG_OOB specnaruse
* OOBINLINE should be set for accepted socket * When OOBINLINE is set, MSG_OOB shouldn't be passed to recv Merge spec/ruby's commit 5b418374f8006318434ee9a2366382d004f585df git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-08Add colon to avoid chkbuild's alertnaruse
https://github.com/ruby/chkbuild/blob/c0448670a9a5cb85f283bc639806ba09b294557f/chkbuild/ruby.rb#L847 Merge ruby/spec's commit 5a6ac7dbef3d59fe279303bf3346d92f1e620f12 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-08Some environments do not have IPv6 address of localhost in /etc/hostskazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e