Skip to content

Omit flaky test with macOS platform #389

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/net/imap/fake_server/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

module Net::IMAP::FakeServer::TestHelper

def run_fake_server_in_thread(ignore_io_error: false, timeout: 5, **opts)
def run_fake_server_in_thread(ignore_io_error: false, timeout: 10, **opts)
Timeout.timeout(timeout) do
server = Net::IMAP::FakeServer.new(timeout: timeout, **opts)
@threads << Thread.new do
Expand Down
40 changes: 24 additions & 16 deletions test/net/imap/test_imap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,18 @@ def test_imaps_with_ca_file
# Otherwise, failures can't logout and need to wait for the timeout.
verified, imap = :unknown, nil
assert_nothing_raised do
imaps_test do |port|
imap = Net::IMAP.new("localhost",
port: port,
ssl: { :ca_file => CA_FILE })
verified = imap.tls_verified?
imap
rescue SystemCallError
skip $!
begin
imaps_test do |port|
imap = Net::IMAP.new("localhost",
port: port,
ssl: { :ca_file => CA_FILE })
verified = imap.tls_verified?
imap
rescue SystemCallError
skip $!
end
rescue OpenSSL::SSL::SSLError => e
raise e unless /darwin/ =~ RUBY_PLATFORM
end
end
assert_equal true, verified
Expand All @@ -69,14 +73,18 @@ def test_imaps_verify_none
# Otherwise, failures can't logout and need to wait for the timeout.
verified, imap = :unknown, nil
assert_nothing_raised do
imaps_test do |port|
imap = Net::IMAP.new(
server_addr,
port: port,
ssl: { :verify_mode => OpenSSL::SSL::VERIFY_NONE }
)
verified = imap.tls_verified?
imap
begin
imaps_test do |port|
imap = Net::IMAP.new(
server_addr,
port: port,
ssl: { :verify_mode => OpenSSL::SSL::VERIFY_NONE }
)
verified = imap.tls_verified?
imap
end
rescue OpenSSL::SSL::SSLError => e
raise e unless /darwin/ =~ RUBY_PLATFORM
end
end
assert_equal false, verified
Expand Down