Skip to content

Commit d48b7a0

Browse files
committed
Experiment the behavior in PTY tests
1 parent 45bcf5b commit d48b7a0

File tree

3 files changed

+13
-31
lines changed

3 files changed

+13
-31
lines changed

.github/workflows/macos.yml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -120,17 +120,6 @@ jobs:
120120
echo "TESTS=${TESTS}" >> $GITHUB_ENV
121121
if: ${{ matrix.test_task == 'check' && matrix.skipped_tests }}
122122

123-
- name: Set up Launchable
124-
uses: ./.github/actions/launchable/setup
125-
with:
126-
os: ${{ matrix.os }}
127-
test-opts: ${{ matrix.test_opts }}
128-
launchable-token: ${{ secrets.LAUNCHABLE_TOKEN }}
129-
launchable-url: ${{ secrets.LAUNCHABLE_BASE_URL }}
130-
builddir: build
131-
srcdir: src
132-
continue-on-error: true
133-
134123
- name: Set extra test options
135124
run: |
136125
echo "TESTS=$TESTS ${{ matrix.test_opts }}" >> $GITHUB_ENV
@@ -140,8 +129,10 @@ jobs:
140129
- name: make ${{ matrix.test_task }}
141130
run: |
142131
ulimit -c unlimited
143-
make -s ${{ matrix.test_task }} ${TESTS:+TESTS="$TESTS"}
144-
timeout-minutes: 60
132+
for i in {1..100}; do
133+
make -s ${{ matrix.test_task }} ${TESTS:+TESTS="$TESTS"}
134+
done
135+
timeout-minutes: 1000
145136
env:
146137
RUBY_TESTOPTS: "-q --tty=no"
147138
TEST_BUNDLED_GEMS_ALLOW_FAILURES: "typeprof"

.github/workflows/yjit-macos.yml

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -116,22 +116,13 @@ jobs:
116116
echo "TESTS=${TESTS}" >> $GITHUB_ENV
117117
if: ${{ matrix.test_task == 'check' && matrix.skipped_tests }}
118118

119-
- name: Set up Launchable
120-
uses: ./.github/actions/launchable/setup
121-
with:
122-
os: macos-14
123-
test-opts: ${{ matrix.configure }}
124-
launchable-token: ${{ secrets.LAUNCHABLE_TOKEN }}
125-
launchable-url: ${{ secrets.LAUNCHABLE_BASE_URL }}
126-
builddir: build
127-
srcdir: src
128-
continue-on-error: true
129-
130119
- name: make ${{ matrix.test_task }}
131120
run: >-
132-
make -s ${{ matrix.test_task }} ${TESTS:+TESTS="$TESTS"}
133-
RUN_OPTS="$RUN_OPTS"
134-
SPECOPTS="$SPECOPTS"
121+
for i in {1..100}; do
122+
make -s ${{ matrix.test_task }} ${TESTS:+TESTS="$TESTS"}
123+
RUN_OPTS="$RUN_OPTS"
124+
SPECOPTS="$SPECOPTS"
125+
done
135126
timeout-minutes: 60
136127
env:
137128
RUBY_TESTOPTS: "-q --tty=no"

test/test_pty.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class TestPTY < Test::Unit::TestCase
1212
RUBY = EnvUtil.rubybin
1313

1414
def test_spawn_without_block
15-
r, w, pid = PTY.spawn(RUBY, '-e', 'puts "a"')
15+
r, w, pid = PTY.spawn(RUBY, '-e', 'puts "a"; sleep 0.1')
1616
rescue RuntimeError
1717
omit $!
1818
else
@@ -24,7 +24,7 @@ def test_spawn_without_block
2424
end
2525

2626
def test_spawn_with_block
27-
PTY.spawn(RUBY, '-e', 'puts "b"') {|r,w,pid|
27+
PTY.spawn(RUBY, '-e', 'puts "b"; sleep 0.1') {|r,w,pid|
2828
begin
2929
assert_equal("b\r\n", r.gets)
3030
ensure
@@ -38,7 +38,7 @@ def test_spawn_with_block
3838
end
3939

4040
def test_commandline
41-
commandline = Shellwords.join([RUBY, '-e', 'puts "foo"'])
41+
commandline = Shellwords.join([RUBY, '-e', 'puts "foo"; sleep 0.1'])
4242
PTY.spawn(commandline) {|r,w,pid|
4343
begin
4444
assert_equal("foo\r\n", r.gets)
@@ -53,7 +53,7 @@ def test_commandline
5353
end
5454

5555
def test_argv0
56-
PTY.spawn([RUBY, "argv0"], '-e', 'puts "bar"') {|r,w,pid|
56+
PTY.spawn([RUBY, "argv0"], '-e', 'puts "bar"; sleep 0.1') {|r,w,pid|
5757
begin
5858
assert_equal("bar\r\n", r.gets)
5959
ensure

0 commit comments

Comments
 (0)