Skip to content

Commit c4f92fc

Browse files
committed
CI: skip Ractor test on Windows to avoid job timeout
Gemini said this: > If a background thread or a Ractor is still "alive" or cleaning up when > the main test suite finishes, the shell might wait for that process to > fully relinquish control.
1 parent 6aa115f commit c4f92fc

2 files changed

Lines changed: 14 additions & 5 deletions

File tree

spec/addressable/uri_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6821,7 +6821,7 @@ def to_str
68216821
expect(
68226822
Ractor.new { Addressable::URI.parse("http://example.com") }.public_send(value_method)
68236823
).to eq(main)
6824-
end
6824+
end unless (TestHelper.is_mri? && TestHelper.is_windows?) # Since Ruby 4 this test made the Windows job time out
68256825
end
68266826

68276827
describe Addressable::URI, "when deferring validation" do

spec/spec_helper.rb

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,20 @@
1919
end if Gem.loaded_specs.key?("simplecov")
2020

2121
class TestHelper
22-
def self.native_supported?
23-
mri = RUBY_ENGINE == "ruby"
24-
windows = RUBY_PLATFORM.include?("mingw")
22+
def self.is_jruby?
23+
Object.const_defined? :JRUBY_VERSION
24+
end
25+
26+
def self.is_mri?
27+
RUBY_ENGINE == "ruby"
28+
end
2529

26-
mri && !windows
30+
def self.is_windows?
31+
RUBY_DESCRIPTION =~ /mswin|ming|cygwin/
32+
end
33+
34+
def self.native_supported?
35+
is_mri? && !is_windows?
2736
end
2837
end
2938

0 commit comments

Comments
 (0)