Граф коммитов

149 Коммитов

Автор SHA1 Сообщение Дата
Nobuyoshi Nakada dc5512243b [ruby/io-wait] Disable ractor test which is meaningless on earlier versions
https://github.com/ruby/io-wait/commit/e8e1e99d4c
2021-11-16 20:25:44 +09:00
Nobuyoshi Nakada d305ae5f04 [ruby/io-wait] Use `omit` as per test-unit
https://github.com/ruby/io-wait/commit/1f59f7b02f
2021-11-16 20:25:41 +09:00
Koichi Sasada 38c555a315 show encoding for each path 2021-11-14 02:41:30 +09:00
Yusuke Endoh 4d8d8c9d49 test/io/console/test_io_console.rb: dump debug output to stderr
make test-all in parallel mode seems to hide stdout
2021-11-14 02:35:03 +09:00
Yusuke Endoh 3aa62b455c test/io/console/test_io_console.rb: add debug code
to debug the following failure

http://ci.rvm.jp/results/trunk-test@ruby-sky1/3708240
```
/tmp/ruby/v3/src/trunk-test/test/io/console/test_io_console.rb:10:in `===': incompatible encoding regexp match (US-ASCII regexp with UTF-16BE string) (Encoding::CompatibilityError)
	/tmp/ruby/v3/src/trunk-test/test/io/console/test_io_console.rb:10:in `each'
	/tmp/ruby/v3/src/trunk-test/test/io/console/test_io_console.rb:10:in `grep'
	/tmp/ruby/v3/src/trunk-test/test/io/console/test_io_console.rb:10:in `<class:TestIO_Console>'
	/tmp/ruby/v3/src/trunk-test/test/io/console/test_io_console.rb:9:in `<top (required)>'
	<internal:/tmp/ruby/v3/src/trunk-test/lib/rubygems/core_ext/kernel_require.rb>:85:in `require'
	<internal:/tmp/ruby/v3/src/trunk-test/lib/rubygems/core_ext/kernel_require.rb>:85:in `require'
	/tmp/ruby/v3/src/trunk-test/tool/lib/test/unit/parallel.rb:122:in `run'
	/tmp/ruby/v3/src/trunk-test/tool/lib/test/unit/parallel.rb:211:in `<main>'
running file: /tmp/ruby/v3/src/trunk-test/test/io/console/test_io_console.rb
```
2021-11-12 16:23:00 +09:00
Nobuyoshi Nakada b9f7286fe9
[ruby/io-console] Skip Interrupt test on Solaris too
https://github.com/ruby/io-console/commit/48db3616da
2021-10-11 11:33:15 +09:00
Nobuyoshi Nakada f6d5de8f33 [ruby/io-wait] Declare as Ractor-safe
Fixes https://bugs.ruby-lang.org/issues/17659

https://github.com/ruby/io-wait/commit/ba338b4764
2021-03-07 09:54:35 +09:00
Nobuyoshi Nakada ef9bde6516 [ruby/io-wait] Refined uncommon device type tests
https://github.com/ruby/io-wait/commit/0c73ebcf5d
2021-03-07 09:54:35 +09:00
Charles Oliver Nutter abf71864a5
[ruby/io-console] Mark all tests that use run_pty as pend on JRuby
JRuby's PTY.spawn does not produce a process with its own
controlling terminal, which is necessary for testing these raw
escape sequences. This commit marks those tests as pending.

The functionality tested appears to work at a command line, but
due to this PTY bug in JRuby we cannot test it this way.

See https://github.com/jruby/jruby/issues/6552

https://github.com/ruby/io-console/commit/a486b72e5e
https://github.com/ruby/io-console/commit/b5c8e7bfd8
2021-02-05 12:29:33 +09:00
Charles Oliver Nutter a1cc044ea1
[ruby/io-console] Use omit instead of skip
This test runs with test/unit now, which defines omit instead of
skip.

https://github.com/ruby/io-console/commit/bd731d0b8d
2021-02-05 12:01:38 +09:00
Charles Oliver Nutter 2a764fe764
[ruby/io-console] Skip test on JRuby
The subprocess script here works fine at a command line, but when
run as a pty subprocess during the tests the master side hangs
waiting for output.

https://github.com/ruby/io-console/commit/4a21610ece
2021-02-05 12:01:38 +09:00
Charles Oliver Nutter 8960d6b5bd
[ruby/io-console] Add console.rb to search for paths
https://github.com/ruby/io-console/commit/74567376c4
2021-02-05 12:01:38 +09:00
Nobuyoshi Nakada 9ef7780b09
[ruby/io-console] Run subprocesses without test libraries
Now io/console is loaded from test-unit indirectly, test-unit
requires power_assert which requires io/console.

https://github.com/ruby/io-console/commit/8817d07951
https://github.com/ruby/io-console/commit/639cce89de
2021-02-05 11:45:04 +09:00
Nobuyoshi Nakada ead8d89bd7 [ruby/io-console] Ignore chomp! result and return the modified string
https://github.com/ruby/io-console/commit/09e5ccc729
2021-01-05 21:26:11 +09:00
Nobuyoshi Nakada a79966743c [ruby/io-console] Fix timeout type error (#18)
Fixed TypeError when IO#getch timed out

`rb_io_wait` returns a bit-flags Integer representing available
events, or Qfalse if timed out.  Also the result of `NUM2INT` is
not a `VALUE`.

```
$ ./bin/ruby -v -rio/console -e "p IO.console.getch(intr: true, time: 0.1)"
ruby 3.0.0dev (2020-10-09T20:27:30Z master 5ea2ea74cc) [x64-mingw32]
-e:1:in `getch': no implicit conversion of false into Integer (TypeError)
        from -e:1:in `<main>'
```

https://github.com/ruby/io-console/commit/3bdfaf62df
2020-10-11 02:00:24 +09:00
Leam Hall f4b9e94317
[ruby/io-console] Bug 17128: In test_set_winsize_console, wrapped re-size in a begin-rescue-else.
https://github.com/ruby/io-console/commit/a22333c33a
2020-08-27 23:46:02 +09:00
Hiroshi SHIBATA ec1ab1d465
Add explicitly require for Dir.mktmpdir 2020-07-30 21:01:22 +09:00
Nobuyoshi Nakada 883214f8e9
Use %w instead of %i not to create unused IDs 2020-05-09 20:13:30 +09:00
Yusuke Endoh 595e74ae4b test/io/console/test_io_console.rb: Rescue Errno::ENXIO for Solaris
https://rubyci.org/logs/rubyci.s3.amazonaws.com/solaris10-gcc/ruby-master/log/20200509T100003Z.fail.html.gz
```
  1) Failure:
TestIO_Console#test_failed_path [/export/home/users/chkbuild/cb-gcc/tmp/build/20200509T100003Z/ruby/test/io/console/test_io_console.rb:40]:
[Errno::ENODEV, Errno::ENOTTY, Errno::EBADF] exception expected, not #<Errno::ENXIO: No such device or address - /dev/null>.
```
2020-05-09 20:07:38 +09:00
Nobuyoshi Nakada 581763d14c [ruby/io-console] Fails with EBADF on mingw
https://github.com/ruby/io-console/commit/530cec574c
2020-05-09 14:51:43 +09:00
Nobuyoshi Nakada d7a59e2ffe
[ruby/io-console] Expanded expected errors
May fail with ENOTTY instead of ENODEV.

https://github.com/ruby/io-console/commit/fe117b89e0
2020-05-09 14:46:08 +09:00
Nobuyoshi Nakada cc9bc14530 [ruby/io-console] Added test for failed path
https://github.com/ruby/io-console/commit/06a540f9b4
2020-05-09 13:57:04 +09:00
Charles Oliver Nutter 569f56e0f7 [ruby/io-console] Filter Ruby engine name rather than just /ruby/
This breaks tests using this path on JRuby because the `jruby`
executable turns into `jjruby` after the sub.

https://github.com/ruby/io-console/commit/e5951aa34c
2020-01-18 00:15:00 +09:00
Nobuyoshi Nakada 31e2f03512 [ruby/io-console] Enable only interrupt bits on `intr: true`
https://github.com/ruby/io-console/commit/baaf929041
2019-12-29 16:26:22 +09:00
Nobuyoshi Nakada a3c5dbf291
Scale sleeping times to wait for the OS operations 2019-12-24 18:53:14 +09:00
Nobuyoshi Nakada 81504e83e7
Synchronize with a Queue instead of sleeping 2019-12-24 15:48:08 +09:00
Koichi Sasada 47ad57f245 Revert "Scale sleeping times"
This reverts commit e57d619421.

Test fails:
http://ci.rvm.jp/results/trunk-gc-asserts@ruby-sky1/2518563
http://ci.rvm.jp/results/trunk-gc_compact@silicon-docker/2518533
2019-12-24 15:38:46 +09:00
Nobuyoshi Nakada e57d619421
Scale sleeping times 2019-12-24 14:56:17 +09:00
Nobuyoshi Nakada c147eeff7c [ruby/io-console] Skip Interrupt test on Linux
Hangs up only in ruby/ruby on Travis-CI.

https://github.com/ruby/io-console/commit/de39aa6dd6
2019-12-18 13:30:52 +09:00
Nobuyoshi Nakada 77e3078ede [ruby/io-console] Set raw mode strictly same as cfmakeraw
* Default VMIN and VTIME to minimum input.
* Disable parity check bits explicitly.
* Disable all bits for flow control on input.

Co-Authored-By: NARUSE, Yui <naruse@airemix.jp>

https://github.com/ruby/io-console/commit/5ce201a686
2019-12-18 10:33:05 +09:00
Nobuyoshi Nakada 07ed8f2f91 [ruby/io-console] Skip interrupt
https://github.com/ruby/io-console/commit/8ed5a2bcc3
2019-12-18 00:08:04 +09:00
Nobuyoshi Nakada 905a926ea8 [ruby/io-console] Timeout in the child process
https://github.com/ruby/io-console/commit/b8411689a5
2019-12-17 23:55:24 +09:00
Nobuyoshi Nakada 4b7d27ca0d [ruby/io-console] Use IO.console instead of STDIN
https://github.com/ruby/io-console/commit/9e3ec5b936
2019-12-17 23:55:22 +09:00
Nobuyoshi Nakada 81eb2d16ef
[ruby/io-console] Disable implementation-defined special control characters
In raw mode with interrupt enabled.

https://github.com/ruby/io-console/commit/e9e8e3ff17
2019-12-17 13:55:04 +09:00
Nobuyoshi Nakada ec89a0f803
[ruby/io-console] Added the test for intr option
https://github.com/ruby/io-console/commit/4f01db102d
2019-12-17 13:55:04 +09:00
Yusuke Endoh 0bca34ddaa test/io/console/test_io_console.rb: add a memo for the mysterious hack 2019-12-05 16:56:08 +09:00
Yusuke Endoh b40bb27e35 test/io/console/test_io_console.rb: Try the hack for Solaris
I'm not entirely sure why, but test_set_winsize_console gets stuck on
Solaris (and if I recall, macOS).  I found a hack for FreeBSD, so I want
to give it a try on Solaris too.
2019-12-05 15:53:29 +09:00
Nobuyoshi Nakada b1c92363a7
Wait for the main thread to start reading by Queue
Otherwise, the written data to pty before the reading started may
be just lost.
2019-12-02 13:17:05 +09:00
Kazuhiro NISHIYAMA c99fb0f41e
Revert "[ruby/io-console] Skip cursor position test on Solaris"
This reverts commit 5294ded681.
2019-09-25 09:48:44 +09:00
Nobuyoshi Nakada c60451d9cd [ruby/io-console] Unique paths to be added
https://github.com/ruby/io-console/commit/a3ad851b6c
2019-09-25 09:43:31 +09:00
Nobuyoshi Nakada fc9eb5b9c1 [ruby/io-console] Load the current libraries
https://github.com/ruby/io-console/commit/ab7653c543
2019-09-25 09:43:29 +09:00
Nobuyoshi Nakada 5294ded681 [ruby/io-console] Skip cursor position test on Solaris
It results in a mysterious failure.

https://github.com/ruby/io-console/commit/e3543c3da4
2019-09-25 08:24:19 +09:00
Nobuyoshi Nakada 10e3267c31 [ruby/io-console] Made cursor position 0-origin
https://github.com/ruby/io-console/commit/9377e37295
2019-09-24 16:20:31 +09:00
k0kubun 271c8f5d06 test_io_wait.rb: try to stabilize test_wait_readable
that randomly fails
https://rubyci.org/logs/mswinci.japaneast.cloudapp.azure.com/vc12-x64/ruby-trunk/log/20181231T103312Z.fail.html.gz

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-31 12:54:40 +00:00
nobu 65dd1434b3 Suppress uninitialized instance variable warnings
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-14 01:29:23 +00:00
normal 6a65f2b1e4 io + socket: make pipes and sockets nonblocking by default
All normal Ruby IO methods (IO#read, IO#gets, IO#write, ...) are
all capable of appearing to be "blocking" when presented with a
file description with the O_NONBLOCK flag set; so there is
little risk of incompatibility within Ruby-using programs.

The biggest compatibility risk is when spawning external
programs.  As a result, stdin, stdout, and stderr are now always
made blocking before exec-family calls.

This change will make an event-oriented MJIT usable if it is
waiting on pipes on POSIX_like platforms.

It is ALSO necessary to take advantage of (proposed lightweight
concurrency (aka "auto-Fiber") or any similar proposal for
network concurrency: https://bugs.ruby-lang.org/issues/13618

Named-pipe (FIFO) are NOT yet non-blocking by default since
they are rarely-used and may introduce compatibility problems
and extra syscall overhead for a common path.

Please revert this commit if there are problems and if I am afk
since I am afk a lot, lately.

[ruby-core:89950] [Bug #14968]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-22 08:46:51 +00:00
normal 32910b8781 test/io/wait/test_io_wait_uncommon.rb: relax /dev/random check
Too many machines lack entropy to have a usable /dev/random.  I
had similar problems on my system until I started using
haveged(8), but we can't require that for CI.

cf. https://rubyci.org/logs/rubyci.s3.amazonaws.com/debian/ruby-trunk/log/20180825T213003Z.fail.html.gz

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64540 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-25 22:32:35 +00:00
normal c7ce155412 test/io/console/test_io_console.rb: fix short read failures
Running with TESTS=--no-retry, I sometimes get short reads
leading to failures due to the use of IO#readpartial instead of
IO#gets.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64248 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-09 09:02:32 +00:00
normal 15d7adf90e test/io/wait/test_io_wait_uncommon.rb (test_tty_wait): increase timeout
Apparently my tty can't keep up when I run test-all with
TESTS='-v --no-retry'

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-09 08:51:22 +00:00
normal 1c8b370840 test/io/console/test_io_console.rb: fix for systems where PTY is not defined
[ruby-core:87420] [Bug #14828]
Thanks-to: MSP-Greg (Greg L)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-06 01:12:23 +00:00