Skip to content

Commit 7f51e4f

Browse files
committed
Retry connect in test_bio_method_custom_exception
1 parent 6c1db60 commit 7f51e4f

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

test/openssl/test_ssl.rb

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2474,15 +2474,27 @@ def test_bio_method_custom_exception
24742474
buf.set_string(str)
24752475
len
24762476
}
2477+
2478+
first = true
24772479
write_proc = ->(buf, len) {
24782480
ops << :write
2479-
raise MyIOError
2481+
if first
2482+
first = false
2483+
raise MyIOError
2484+
end
2485+
2486+
str = buf.get_string(0, len)
2487+
len = io.write(str)
2488+
len
24802489
}
24812490

24822491
ssl.bio_method = [read_proc, write_proc]
24832492

24842493
assert_raise(MyIOError) { ssl.connect }
24852494
assert_equal [:write], ops
2495+
2496+
ssl.connect
2497+
assert_equal [:write, :read], ops.uniq
24862498
ensure
24872499
ssl&.close rescue nil
24882500
end

0 commit comments

Comments
 (0)