From ec4c349c1fc2ba3417ba40eae363fdf18f45b7f4 Mon Sep 17 00:00:00 2001 From: Patrick Plenefisch Date: Sun, 2 Oct 2022 11:08:58 -0400 Subject: [PATCH 1/3] JRuby should soon support PTY.spawn --- test/io/console/test_io_console.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/io/console/test_io_console.rb b/test/io/console/test_io_console.rb index 838abb4..61ddb50 100644 --- a/test/io/console/test_io_console.rb +++ b/test/io/console/test_io_console.rb @@ -631,8 +631,6 @@ def helper end def run_pty(src, n = 1) - pend("PTY.spawn cannot control terminal on JRuby") if RUBY_ENGINE == 'jruby' - args = [TestIO_Console::INCLUDE_OPTS, "-rio/console", "-e", src] args.shift if args.first == "-I" # statically linked r, w, pid = PTY.spawn(EnvUtil.rubybin, *args) From 4f01ad2c1806cb24b5f496daa274f564b808a30c Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sat, 12 Sep 2026 23:45:15 +0900 Subject: [PATCH 2/3] Skip interrupt with timeout on JRuby May be an issue of PTY on JRuby? --- test/io/console/test_io_console.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/io/console/test_io_console.rb b/test/io/console/test_io_console.rb index 61ddb50..13a26ee 100644 --- a/test/io/console/test_io_console.rb +++ b/test/io/console/test_io_console.rb @@ -535,6 +535,7 @@ def assert_ctrl(expect, cc, r, w) w.print cc w.flush result = EnvUtil.timeout(3) {r.gets} + assert_not_nil(result) if result case cc.chr when "\C-A".."\C-_" @@ -572,7 +573,7 @@ def test_intr if cc = ctrl["intr"] assert_ctrl("#{cc.ord}", cc, r, w) assert_ctrl("#{cc.ord}", cc, r, w) - assert_ctrl("Interrupt", cc, r, w) unless host_os?(/linux/) + assert_ctrl("Interrupt", cc, r, w) unless host_os?(/linux/) or RUBY_ENGINE == "jruby" end if cc = ctrl["dsusp"] assert_ctrl("#{cc.ord}", cc, r, w) From 2f0b18b30337e6aa3fb733e1ad4da78f2578e580 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sat, 12 Sep 2026 22:30:25 +0900 Subject: [PATCH 3/3] Run tests verbosely on JRuby --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2e8777e..834a8d7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -52,6 +52,8 @@ jobs: - name: Run test run: rake # Attempting without 'bundle exec' timeout-minutes: 3 + env: + TESTOPTS: ${{ startsWith(matrix.ruby, 'jruby') && '--verbose=verbose' || '' }} - id: build run: | rake build