Skip to content

Commit d91b656

Browse files
committed
Do not check state on other threads in autoload spec
* It's unclear if the MRI semantics are correct, see https://bugs.ruby-lang.org/issues/15663 * The constant should logically remain defined on other threads while it is loading.
1 parent f7e8580 commit d91b656

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

spec/ruby/core/module/autoload_spec.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ module ModuleSpecs::Autoload
260260
nested_require = -> {
261261
result = nil
262262
ScratchPad.record -> {
263-
result = [@check.call, Thread.new { @check.call }.value]
263+
result = @check.call
264264
}
265265
require nested
266266
result
@@ -269,9 +269,7 @@ module ModuleSpecs::Autoload
269269

270270
@check.call.should == ["constant", @path]
271271
require @path
272-
cur, other = ScratchPad.recorded
273-
cur.should == [nil, nil]
274-
other.should == [nil, nil]
272+
ScratchPad.recorded.should == [nil, nil]
275273
@check.call.should == ["constant", nil]
276274
end
277275
end

0 commit comments

Comments
 (0)