diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f3f76ab..21f7f47 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,6 +17,11 @@ jobs: matrix: ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }} os: [ ubuntu-latest, macos-latest ] + include: + - os: windows-latest + ruby: 2.6 + - os: windows-latest + ruby: 3.4 exclude: - os: macos-latest ruby: truffleruby diff --git a/test/test_timeout.rb b/test/test_timeout.rb index 199b18e..42db4eb 100644 --- a/test/test_timeout.rb +++ b/test/test_timeout.rb @@ -425,7 +425,9 @@ def test_timeout_in_trap_handler rd, wr = IO.pipe - trap("SIGUSR1") do + signal = Signal.list["USR1"] ? :USR1 : :TERM + + trap(signal) do begin Timeout.timeout(0.1) do sleep 1 @@ -440,9 +442,9 @@ def test_timeout_in_trap_handler end end - Process.kill :USR1, Process.pid + Process.kill signal, Process.pid assert_equal "OK", rd.read rd.close - end if Signal.list["USR1"] # Windows has no SIGUSR1 + end end