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

Avoid to run rspec tests directly from Gradle script #15889

Open
andsel opened this issue Feb 1, 2024 · 1 comment
Open

Avoid to run rspec tests directly from Gradle script #15889

andsel opened this issue Feb 1, 2024 · 1 comment

Comments

@andsel
Copy link
Contributor

andsel commented Feb 1, 2024

Running rubyTests with JDK 21 exposes the error:

            should end at the number of generated events (FAILED - 3)
    [2024-02-01T14:18:25,583][ERROR][logstash.javapipeline    ] Pipeline error {:pipeline_id=>"main", :exception=>#<ArgumentError: wrong number of arguments (given 1, expected 0)>, 
:backtrace=>[
"/Users/andrea/workspace/logstash_andsel/logstash-core/lib/logstash/config/lir_serializer.rb:47:in `vertices'", 
"/Users/andrea/workspace/logstash_andsel/logstash-core/lib/logstash/config/lir_serializer.rb:36:in `serialize'", 
"/Users/andrea/workspace/logstash_andsel/logstash-core/lib/logstash/config/lir_serializer.rb:27:in `serialize'", 
"/Users/andrea/workspace/logstash_andsel/logstash-core/lib/logstash/java_pipeline.rb:268:in `start_workers'", 
"/Users/andrea/workspace/logstash_andsel/logstash-core/lib/logstash/java_pipeline.rb:194:in `run'", 
"/Users/andrea/workspace/logstash_andsel/logstash-core/lib/logstash/java_pipeline.rb:146:in `block in start'"
], 
"pipeline.sources"=>[], :thread=>"#<Thread:0x5e2f743e /Users/andrea/workspace/logstash_andsel/logstash-core/lib/logstash/java_pipeline.rb:134 run>"}

To reproduce consider the PR #15719, after set system java to a JDK 21, run with:

SPEC_OPTS="-fd -P logstash-core/spec/logstash/pipeline_reporter_spec.rb" ./gradlew :logstash-core:rubyTests --tests org.logstash.RSpecTests --rerun-tasks

The problem happens at

graph.getVertices.map {|v| vertex(v) }.compact

Where getVertices returns a LinkedHashSet.
This error was isolated in JRuby issue jruby/jruby#8061, however originates from the fact that Logstash's rubyTests Gradle tasks, executes a JRuby script engine within the Gradle process itself:

This issue asks to switch the execution of rubyTest into a separated process, outside of the Gradle daemon, so that the test environment could be more close to what the real environment is, without interference of Gradle internals itself.

@andsel
Copy link
Contributor Author

andsel commented Feb 1, 2024

/cc @roaksoax @jsvd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant