Skip to content
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

Run the cucumber test in unbundled environment #4130

Merged
merged 1 commit into from
Nov 20, 2024
Merged

Conversation

p-datadog
Copy link
Contributor

@p-datadog p-datadog commented Nov 18, 2024

What does this PR do?
This PR tries to fix intermittent failures in cucumber development? spec by running it in the unbundled environment.

Motivation:
The test is flaky.

Change log entry
None

Additional Notes:
I am not sure that this is the correct fix, but when the test is failing, it appears to be loading psych from two locations (ruby base runtime and gem path). Since the test does not clear its environment, it might be inheriting some paths from the test suite, but then tries to load bundler and its own set of gems, which is problematic?

How to test the change?

CI consistently passing

@p-datadog p-datadog requested a review from a team as a code owner November 18, 2024 21:28
@github-actions github-actions bot added the dev/testing Involves testing processes (e.g. RSpec) label Nov 18, 2024
@p-datadog
Copy link
Contributor Author

The failure:



Failures:

  1) Datadog::Core::Environment::Execution.development? when not in an RSpec test for Cucumber returns true
     Failure/Error: expect(err).to include('ACTUAL:true')
     
       expected "/usr/local/lib/ruby/3.0.0/psych/versions.rb:5: warning: already initialized constant Psych::VERSION\... /usr/local/lib/ruby/site_ruby/3.0.0/bundler/worker.rb:90:in `block (2 levels) in create_threads'\n" to include "ACTUAL:true"
       Diff:
       @@ -1,141 +1,281 @@
       -ACTUAL:true
       +/usr/local/lib/ruby/3.0.0/psych/versions.rb:5: warning: already initialized constant Psych::VERSION
       +/usr/local/bundle/gems/psych-5.1.2/lib/psych/versions.rb:5: warning: previous definition of VERSION was here
       +/usr/local/lib/ruby/3.0.0/psych/class_loader.rb:7: warning: already initialized constant Psych::ClassLoader::BIG_DECIMAL
       +/usr/local/bundle/gems/psych-5.1.2/lib/psych/class_loader.rb:7: warning: previous definition of BIG_DECIMAL was here
       +/usr/local/lib/ruby/3.0.0/psych/class_loader.rb:8: warning: already initialized constant Psych::ClassLoader::COMPLEX
       +/usr/local/bundle/gems/psych-5.1.2/lib/psych/class_loader.rb:8: warning: previous definition of COMPLEX was here
       +/usr/local/lib/ruby/3.0.0/psych/class_loader.rb:9: warning: already initialized constant Psych::ClassLoader::DATE
       +/usr/local/bundle/gems/psych-5.1.2/lib/psych/class_loader.rb:9: warning: previous definition of DATE was here
       +/usr/local/lib/ruby/3.0.0/psych/class_loader.rb:10: warning: already initialized constant Psych::ClassLoader::DATE_TIME
       +/usr/local/bundle/gems/psych-5.1.2/lib/psych/class_loader.rb:10: warning: previous definition of DATE_TIME was here
       +/usr/local/lib/ruby/3.0.0/psych/class_loader.rb:11: warning: already initialized constant Psych::ClassLoader::EXCEPTION
       +/usr/local/bundle/gems/psych-5.1.2/lib/psych/class_loader.rb:11: warning: previous definition of EXCEPTION was here
       +/usr/local/lib/ruby/3.0.0/psych/class_loader.rb:12: warning: already initialized constant Psych::ClassLoader::OBJECT
       +/usr/local/bundle/gems/psych-5.1.2/lib/psych/class_loader.rb:12: warning: previous definition of OBJECT was here
       +/usr/local/lib/ruby/3.0.0/psych/class_loader.rb:13: warning: already initialized constant Psych::ClassLoader::PSYCH_OMAP
       +/usr/local/bundle/gems/psych-5.1.2/lib/psych/class_loader.rb:13: warning: previous definition of PSYCH_OMAP was here
       +/usr/local/lib/ruby/3.0.0/psych/class_loader.rb:14: warning: already initialized constant Psych::ClassLoader::PSYCH_SET
       +/usr/local/bundle/gems/psych-5.1.2/lib/psych/class_loader.rb:14: warning: previous definition of PSYCH_SET was here
       +/usr/local/lib/ruby/3.0.0/psych/class_loader.rb:15: warning: already initialized constant Psych::ClassLoader::RANGE
       +/usr/local/bundle/gems/psych-5.1.2/lib/psych/class_loader.rb:15: warning: previous definition of RANGE was here
       +/usr/local/lib/ruby/3.0.0/psych/class_loader.rb:16: warning: already initialized constant Psych::ClassLoader::RATIONAL
       +/usr/local/bundle/gems/psych-5.1.2/lib/psych/class_loader.rb:16: warning: previous definition of RATIONAL was here
       +/usr/local/lib/ruby/3.0.0/psych/class_loader.rb:17: warning: already initialized constant Psych::ClassLoader::REGEXP
       +/usr/local/bundle/gems/psych-5.1.2/lib/psych/class_loader.rb:17: warning: previous definition of REGEXP was here
       +/usr/local/lib/ruby/3.0.0/psych/class_loader.rb:18: warning: already initialized constant Psych::ClassLoader::STRUCT
       +/usr/local/bundle/gems/psych-5.1.2/lib/psych/class_loader.rb:18: warning: previous definition of STRUCT was here
       +/usr/local/lib/ruby/3.0.0/psych/class_loader.rb:19: warning: already initialized constant Psych::ClassLoader::SYMBOL
       +/usr/local/bundle/gems/psych-5.1.2/lib/psych/class_loader.rb:19: warning: previous definition of SYMBOL was here
       +(eval):2: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!
       +(eval):2: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!
       +(eval):2: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!
       +(eval):2: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!
       +(eval):2: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!
       +(eval):2: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!
       +(eval):2: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!
       +(eval):2: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!
       +(eval):2: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!
       +(eval):2: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!
       +/usr/local/lib/ruby/3.0.0/psych/class_loader.rb:7: warning: already initialized constant Psych::ClassLoader::BIG_DECIMAL
       +/usr/local/lib/ruby/3.0.0/psych/class_loader.rb:7: warning: previous definition of BIG_DECIMAL was here
       +/usr/local/lib/ruby/3.0.0/psych/class_loader.rb:8: warning: already initialized constant Psych::ClassLoader::COMPLEX
       +/usr/local/lib/ruby/3.0.0/psych/class_loader.rb:8: warning: previous definition of COMPLEX was here
       +/usr/local/lib/ruby/3.0.0/psych/class_loader.rb:9: warning: already initialized constant Psych::ClassLoader::DATE
       +/usr/local/lib/ruby/3.0.0/psych/class_loader.rb:9: warning: previous definition of DATE was here
       +/usr/local/lib/ruby/3.0.0/psych/class_loader.rb:10: warning: already initialized constant Psych::ClassLoader::DATE_TIME
       +/usr/local/lib/ruby/3.0.0/psych/class_loader.rb:10: warning: previous definition of DATE_TIME was here
       +/usr/local/lib/ruby/3.0.0/psych/class_loader.rb:11: warning: already initialized constant Psych::ClassLoader::EXCEPTION
       +/usr/local/lib/ruby/3.0.0/psych/class_loader.rb:11: warning: previous definition of EXCEPTION was here
       +/usr/local/lib/ruby/3.0.0/psych/class_loader.rb:12: warning: already initialized constant Psych::ClassLoader::OBJECT
       +/usr/local/lib/ruby/3.0.0/psych/class_loader.rb:12: warning: previous definition of OBJECT was here
       +/usr/local/lib/ruby/3.0.0/psych/class_loader.rb:13: warning: already initialized constant Psych::ClassLoader::PSYCH_OMAP
       +/usr/local/lib/ruby/3.0.0/psych/class_loader.rb:13: warning: previous definition of PSYCH_OMAP was here
       +/usr/local/lib/ruby/3.0.0/psych/class_loader.rb:14: warning: already initialized constant Psych::ClassLoader::PSYCH_SET
       +/usr/local/lib/ruby/3.0.0/psych/class_loader.rb:14: warning: previous definition of PSYCH_SET was here
       +/usr/local/lib/ruby/3.0.0/psych/class_loader.rb:15: warning: already initialized constant Psych::ClassLoader::RANGE
       +/usr/local/lib/ruby/3.0.0/psych/class_loader.rb:15: warning: previous definition of RANGE was here
       +/usr/local/lib/ruby/3.0.0/psych/class_loader.rb:16: warning: already initialized constant Psych::ClassLoader::RATIONAL
       +/usr/local/lib/ruby/3.0.0/psych/class_loader.rb:16: warning: previous definition of RATIONAL was here
       +/usr/local/lib/ruby/3.0.0/psych/class_loader.rb:17: warning: already initialized constant Psych::ClassLoader::REGEXP
       +/usr/local/lib/ruby/3.0.0/psych/class_loader.rb:17: warning: previous definition of REGEXP was here
       +/usr/local/lib/ruby/3.0.0/psych/class_loader.rb:18: warning: already initialized constant Psych::ClassLoader::STRUCT
       +/usr/local/lib/ruby/3.0.0/psych/class_loader.rb:18: warning: previous definition of STRUCT was here
       +/usr/local/lib/ruby/3.0.0/psych/class_loader.rb:19: warning: already initialized constant Psych::ClassLoader::SYMBOL
       +/usr/local/lib/ruby/3.0.0/psych/class_loader.rb:19: warning: previous definition of SYMBOL was here
       +(eval):2: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!
       +(eval):2: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!
       +(eval):2: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!
       +(eval):2: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!
       +(eval):2: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!
       +(eval):2: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!
       +(eval):2: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!
       +(eval):2: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!
       +(eval):2: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!
       +(eval):2: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!
       +/usr/local/lib/ruby/3.0.0/psych/class_loader.rb:38:in `class_eval': (eval):2: syntax error, unexpected ',', expecting '}' (SyntaxError)
       +  load {"Complex"=>Complex, "Exception"=>Exception, "Psy...
       +                          ^
       +(eval):2: syntax error, unexpected ',', expecting `end'
       +...omplex, "Exception"=>Exception, "Psych::Omap"=>Psych::Omap, ...
       +...                              ^
       +(eval):2: syntax error, unexpected ',', expecting `end'
       +...on, "Psych::Omap"=>Psych::Omap, "Psych::Set"=>Psych::Set, "R...
       +...                              ^
       +(eval):2: syntax error, unexpected ',', expecting `end'
       +...Omap, "Psych::Set"=>Psych::Set, "Range"=>Range, "Rational"=>...
       +...                              ^
       +(eval):2: syntax error, unexpected ',', expecting `end'
       +...t"=>Psych::Set, "Range"=>Range, "Rational"=>Rational, "Regex...
       +...                              ^
       +(eval):2: syntax error, unexpected ',', expecting `end'
       +..."=>Range, "Rational"=>Rational, "Regexp"=>Regexp, "Struct"=>...
       +...                              ^
       +(eval):2: syntax error, unexpected ',', expecting `end'
       +...l"=>Rational, "Regexp"=>Regexp, "Struct"=>Struct, "Symbol"=>...
       +...                              ^
       +(eval):2: syntax error, unexpected ',', expecting `end'
       +...exp"=>Regexp, "Struct"=>Struct, "Symbol"=>Symbol, "Object"=>...
       +...                              ^
       +(eval):2: syntax error, unexpected ',', expecting `end'
       +...uct"=>Struct, "Symbol"=>Symbol, "Object"=>Object}
       +...                              ^
       +(eval):2: syntax error, unexpected '}', expecting `end'
       +...bol"=>Symbol, "Object"=>Object}
       +...                              ^
       +        from /usr/local/lib/ruby/3.0.0/psych/class_loader.rb:38:in `block in <class:ClassLoader>'
       +        from /usr/local/lib/ruby/3.0.0/psych/class_loader.rb:36:in `each'
       +        from /usr/local/lib/ruby/3.0.0/psych/class_loader.rb:36:in `<class:ClassLoader>'
       +        from /usr/local/lib/ruby/3.0.0/psych/class_loader.rb:6:in `<module:Psych>'
       +        from /usr/local/lib/ruby/3.0.0/psych/class_loader.rb:5:in `<top (required)>'
       +        from <internal:/usr/local/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
       +        from <internal:/usr/local/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
       +        from /usr/local/lib/ruby/3.0.0/psych/nodes/node.rb:3:in `<top (required)>'
       +        from <internal:/usr/local/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
       +        from <internal:/usr/local/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
       +        from /usr/local/lib/ruby/3.0.0/psych/nodes.rb:2:in `<top (required)>'
       +        from <internal:/usr/local/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
       +        from <internal:/usr/local/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
       +        from /usr/local/lib/ruby/3.0.0/psych.rb:15:in `<top (required)>'
       +        from <internal:/usr/local/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
       +        from <internal:/usr/local/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
       +        from /usr/local/lib/ruby/site_ruby/3.0.0/rubygems.rb:594:in `load_yaml'
       +        from /usr/local/lib/ruby/site_ruby/3.0.0/rubygems/package.rb:555:in `read_checksums'
       +        from /usr/local/lib/ruby/site_ruby/3.0.0/rubygems/package.rb:617:in `block (2 levels) in verify'
       +        from /usr/local/lib/ruby/site_ruby/3.0.0/rubygems/package/tar_reader.rb:25:in `new'
       +        from /usr/local/lib/ruby/site_ruby/3.0.0/rubygems/package.rb:616:in `block in verify'
       +        from /usr/local/lib/ruby/site_ruby/3.0.0/rubygems/package/file_source.rb:30:in `open'
       +        from /usr/local/lib/ruby/site_ruby/3.0.0/rubygems/package/file_source.rb:30:in `with_read_io'
       +        from /usr/local/lib/ruby/site_ruby/3.0.0/rubygems/package.rb:615:in `verify'
       +        from /usr/local/lib/ruby/site_ruby/3.0.0/rubygems/package.rb:596:in `spec'
       +        from /usr/local/lib/ruby/site_ruby/3.0.0/rubygems/installer.rb:275:in `spec'
       +        from /usr/local/lib/ruby/site_ruby/3.0.0/bundler/rubygems_gem_installer.rb:134:in `spec'
       +        from /usr/local/lib/ruby/site_ruby/3.0.0/bundler/source/rubygems.rb:186:in `install'
       +        from /usr/local/lib/ruby/site_ruby/3.0.0/bundler/installer/gem_installer.rb:55:in `install'
       +        from /usr/local/lib/ruby/site_ruby/3.0.0/bundler/installer/gem_installer.rb:17:in `install_from_spec'
       +        from /usr/local/lib/ruby/site_ruby/3.0.0/bundler/installer/parallel_installer.rb:133:in `do_install'
       +        from /usr/local/lib/ruby/site_ruby/3.0.0/bundler/installer/parallel_installer.rb:124:in `block in worker_pool'
       +        from /usr/local/lib/ruby/site_ruby/3.0.0/bundler/worker.rb:62:in `apply_func'
       +        from /usr/local/lib/ruby/site_ruby/3.0.0/bundler/worker.rb:57:in `block in process_queue'
       +        from /usr/local/lib/ruby/site_ruby/3.0.0/bundler/worker.rb:54:in `loop'
       +        from /usr/local/lib/ruby/site_ruby/3.0.0/bundler/worker.rb:54:in `process_queue'
       +        from /usr/local/lib/ruby/site_ruby/3.0.0/bundler/worker.rb:90:in `block (2 levels) in create_threads'
       
     # ./spec/datadog/core/environment/execution_spec.rb:202:in `block (8 levels) in <top (required)>'
     # ./spec/datadog/core/environment/execution_spec.rb:192:in `block (7 levels) in <top (required)>'
     # ./spec/datadog/core/environment/execution_spec.rb:191:in `chdir'
     # ./spec/datadog/core/environment/execution_spec.rb:191:in `block (6 levels) in <top (required)>'
     # ./spec/datadog/core/environment/execution_spec.rb:190:in `block (5 levels) in <top (required)>'
     # ./spec/datadog/core/environment/execution_spec.rb:37:in `block (4 levels) in <top (required)>'
     # ./spec/datadog/core/environment/execution_spec.rb:11:in `block (2 levels) in <top (required)>'
     # ./spec/spec_helper.rb:237:in `block (2 levels) in <top (required)>'
     # ./spec/spec_helper.rb:122:in `block (2 levels) in <top (required)>'
     # /usr/local/bundle/gems/webmock-3.13.0/lib/webmock/rspec.rb:37:in `block (2 levels) in <top (required)>'
     # /usr/local/bundle/gems/rspec-wait-0.0.9/lib/rspec/wait.rb:46:in `block (2 levels) in <top (required)>'

Finished in 1 minute 58.42 seconds (files took 3.26 seconds to load)
4892 examples, 1 failure, 53 pending

Just putting the test in unbundled environment does not fix the failure, but I am wondering if it is a correct thing to do anyway?

@p-datadog
Copy link
Contributor Author

I am also noticing from the failure message that first load of psych is from /usr/local/bundle/gems/psych-5.1.2 and the second one is from /usr/local/lib/ruby/3.0.0, which I think should not be happening - the built-in psych shouldn't be overriding the gem one?

@pr-commenter
Copy link

pr-commenter bot commented Nov 18, 2024

Benchmarks

Benchmark execution time: 2024-11-18 22:05:02

Comparing candidate commit fd13324 in PR branch fix-cucumber-spec with baseline commit 9b97769 in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 31 metrics, 2 unstable metrics.

@p-datadog
Copy link
Contributor Author

p-datadog commented Nov 18, 2024

The exception is coming from class_loader.rb which cannot be loaded twice. To reproduce, execute from cloned psych tree:

 load 'lib/psych/class_loader.rb'
 load 'lib/psych/class_loader.rb'

The file in question is substantially the same for both of the relevant versions (3.3.2 and 5.1.2).

big% irb
irb(main):001:0> load 'lib/psych/class_loader.rb'
=> true
irb(main):002:0> load 'lib/psych/class_loader.rb'
lib/psych/class_loader.rb:7: warning: already initialized constant Psych::ClassLoader::BIG_DECIMAL
lib/psych/class_loader.rb:7: warning: previous definition of BIG_DECIMAL was here
lib/psych/class_loader.rb:8: warning: already initialized constant Psych::ClassLoader::COMPLEX
lib/psych/class_loader.rb:8: warning: previous definition of COMPLEX was here
lib/psych/class_loader.rb:9: warning: already initialized constant Psych::ClassLoader::DATE
lib/psych/class_loader.rb:9: warning: previous definition of DATE was here
lib/psych/class_loader.rb:10: warning: already initialized constant Psych::ClassLoader::DATE_TIME
lib/psych/class_loader.rb:10: warning: previous definition of DATE_TIME was here
lib/psych/class_loader.rb:11: warning: already initialized constant Psych::ClassLoader::EXCEPTION
lib/psych/class_loader.rb:11: warning: previous definition of EXCEPTION was here
lib/psych/class_loader.rb:12: warning: already initialized constant Psych::ClassLoader::OBJECT
lib/psych/class_loader.rb:12: warning: previous definition of OBJECT was here
lib/psych/class_loader.rb:13: warning: already initialized constant Psych::ClassLoader::PSYCH_OMAP
lib/psych/class_loader.rb:13: warning: previous definition of PSYCH_OMAP was here
lib/psych/class_loader.rb:14: warning: already initialized constant Psych::ClassLoader::PSYCH_SET
lib/psych/class_loader.rb:14: warning: previous definition of PSYCH_SET was here
lib/psych/class_loader.rb:15: warning: already initialized constant Psych::ClassLoader::RANGE
lib/psych/class_loader.rb:15: warning: previous definition of RANGE was here
lib/psych/class_loader.rb:16: warning: already initialized constant Psych::ClassLoader::RATIONAL
lib/psych/class_loader.rb:16: warning: previous definition of RATIONAL was here
lib/psych/class_loader.rb:17: warning: already initialized constant Psych::ClassLoader::REGEXP
lib/psych/class_loader.rb:17: warning: previous definition of REGEXP was here
lib/psych/class_loader.rb:18: warning: already initialized constant Psych::ClassLoader::STRUCT
lib/psych/class_loader.rb:18: warning: previous definition of STRUCT was here
lib/psych/class_loader.rb:19: warning: already initialized constant Psych::ClassLoader::SYMBOL
lib/psych/class_loader.rb:19: warning: previous definition of SYMBOL was here
lib/psych/class_loader.rb:40: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!
lib/psych/class_loader.rb:40: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!
lib/psych/class_loader.rb:40: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!
lib/psych/class_loader.rb:40: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!
lib/psych/class_loader.rb:40: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!
lib/psych/class_loader.rb:40: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!
lib/psych/class_loader.rb:40: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!
lib/psych/class_loader.rb:40: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!
lib/psych/class_loader.rb:40: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!
lib/psych/class_loader.rb:40: warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!
lib/psych/class_loader.rb:38:in `class_eval': lib/psych/class_loader.rb:40: syntax error, unexpected ',', expecting '}' (SyntaxError)
...ad {"Psych::Omap"=>Psych::Omap, "Psych::Set"=>Psych::Set, "R...
...                              ^
lib/psych/class_loader.rb:40: syntax error, unexpected ',', expecting `end'
...Omap, "Psych::Set"=>Psych::Set, "Range"=>Range, "Rational"=>...
...                              ^
lib/psych/class_loader.rb:40: syntax error, unexpected ',', expecting `end'
...t"=>Psych::Set, "Range"=>Range, "Rational"=>Rational, "Regex...
...                              ^
lib/psych/class_loader.rb:40: syntax error, unexpected ',', expecting `end'
..."=>Range, "Rational"=>Rational, "Regexp"=>Regexp, "Struct"=>...
...                              ^
lib/psych/class_loader.rb:40: syntax error, unexpected ',', expecting `end'
...l"=>Rational, "Regexp"=>Regexp, "Struct"=>Struct, "Symbol"=>...
...                              ^
lib/psych/class_loader.rb:40: syntax error, unexpected ',', expecting `end'
...exp"=>Regexp, "Struct"=>Struct, "Symbol"=>Symbol, "Complex"=...
...                              ^
lib/psych/class_loader.rb:40: syntax error, unexpected ',', expecting `end'
...uct"=>Struct, "Symbol"=>Symbol, "Complex"=>Complex, "Excepti...
...                              ^
lib/psych/class_loader.rb:40: syntax error, unexpected ',', expecting `end'
...l"=>Symbol, "Complex"=>Complex, "Exception"=>Exception, "Obj...
...                              ^
lib/psych/class_loader.rb:40: syntax error, unexpected ',', expecting `end'
...omplex, "Exception"=>Exception, "Object"=>Object}
...                              ^
lib/psych/class_loader.rb:40: syntax error, unexpected '}', expecting `end'
..."=>Exception, "Object"=>Object}
...                              ^
	from lib/psych/class_loader.rb:38:in `block in <class:ClassLoader>'
	from lib/psych/class_loader.rb:36:in `each'
	from lib/psych/class_loader.rb:36:in `<class:ClassLoader>'
	from lib/psych/class_loader.rb:6:in `<module:Psych>'
	from lib/psych/class_loader.rb:5:in `<top (required)>'
	from (irb):2:in `load'
	from (irb):2:in `<main>'
	from /home/w/.rbenv/versions/3.0.7/lib/ruby/gems/3.0.0/gems/irb-1.3.5/exe/irb:11:in `<top (required)>'
	from /home/w/.rbenv/versions/3.0/bin/irb:23:in `load'
	from /home/w/.rbenv/versions/3.0/bin/irb:23:in `<main>'

@p-datadog
Copy link
Contributor Author

psych itself uses require for its sub-parts in 3.3.2 and require_relative in 5.1.2, meaning once the top-level psych.rb is loading, that will attempt to load all of the nested files for that respective version even if the other version is already loaded (which wouldn't be the case if both used require).

@TonyCTHsu TonyCTHsu merged commit ec23c49 into master Nov 20, 2024
286 checks passed
@TonyCTHsu TonyCTHsu deleted the fix-cucumber-spec branch November 20, 2024 15:37
@github-actions github-actions bot added this to the 2.8.0 milestone Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev/testing Involves testing processes (e.g. RSpec)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants