elastic / elastic/logstash

rubyTests failing in 8.12.2 logstash

Open
#16,025 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

test failure
Dominant language
Java
Stars
14.9k
Forks
3.5k
Avg merge
1d 4h
Merged PRs (30d)
88

Description

Repro line:

./gradlew rubyTests --stacktrace

Below errors are seen during execution of above command:
org.logstash.RSpecTests > rspecTests[core tests] FAILED java.lang.AssertionError: RSpec test suite core testssaw at least one failure. at org.junit.Assert.fail(Assert.java:88) at org.logstash.RSpecTests.rspecTests(RSpecTests.java:72

Below are some of the failures:

rspec ./logstash-core/spec/logstash/api/modules/root_spec.rb:26 # LogStash::Api::Modules::Root should respond to root resource rspec ./logstash-core/spec/logstash/api/modules/root_spec.rb:23 # LogStash::Api::Modules::Root should return a 404 to unknown request rspec './logstash-core/spec/logstash/api/modules/node_stats_spec.rb[1:1]' # LogStash::Api::Modules::NodeStats should return a 404 to unknown request rspec './logstash-core/spec/logstash/api/modules/node_stats_spec.rb[1:2:1]' # LogStash::Api::Modules::NodeStats GET / should respond OK rspec './logstash-core/spec/logstash/api/modules/node_stats_spec.rb[1:2:3]' # LogStash::Api::Modules::NodeStats GET / should set 'jvm.uptime_in_millis' at '/' to be a 'Numeric' rspec './logstash-core/spec/logstash/api/modules/node_stats_spec.rb[1:2:4]' # LogStash::Api::Modules::NodeStats GET / should set 'jvm.threads.count' at '/' to be a 'Numeric' rspec './logstash-core/spec/logstash/api/modules/node_stats_spec.rb[1:2:5]' # LogStash::Api::Modules::NodeStats GET / should set 'jvm.threads.peak_count' at '/' to be a 'Numeric' rspec './logstash-core/spec/logstash/api/modules/node_stats_spec.rb[1:2:6]' # LogStash::Api::Modules::NodeStats GET / should set 'jvm.gc.collectors.young.collection_count' at '/' to be a 'Numeric' rspec './logstash-core/spec/logstash/api/modules/node_stats_spec.rb[1:2:7]' # LogStash::Api::Modules::NodeStats GET / should set 'jvm.gc.collectors.young.collection_time_in_millis' at '/' to be a 'Numeric' rspec './logstash-core/spec/logstash/api/modules/node_stats_spec.rb[1:2:8]' # LogStash::Api::Modules::NodeStats GET / should set 'jvm.gc.collectors.old.collection_count' at '/' to be a 'Numeric'

Most of the failures are like below, with Argument Errors as:

` LogStash::Api::Modules::Logging#logging when setting a logger's log level should throw error when key logger is invalid
Failure/Error: status = RSpec::Core::Runner.run(ARGV.empty? ? ($JUNIT_ARGV || ["spec"]) : ARGV).to_i

       ArgumentError:
         Setting "xpack.geoip.downloader.enabled" doesn't exist. Please check if you haven't made a typo.
       # ./logstash-core/lib/logstash/settings.rb:104:in `get_setting'
       # ./logstash-core/lib/logstash/settings.rb:136:in `get_value'
       # ./x-pack/lib/geoip_database_management/manager.rb:52:in `initialize'
       # ./logstash-core/lib/logstash/agent.rb:633:in `initialize_geoip_database_metrics'
       # ./logstash-core/lib/logstash/agent.rb:97:in `initialize'
       # ./logstash-core/spec/support/helpers.rb:57:in `make_test_agent'
       # ./logstash-core/spec/support/shared_contexts.rb:62:in `block in <main>'
       # ./lib/bootstrap/rspec.rb:36:in `<main>'

`

Reproduces locally?: yes

Applicable branches: 8.12.0 onwards

Failure history:
Fails from 8.12.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Run ./gradlew rubyTests --stacktrace and start with logstash-core/lib/logstash/settings.rb:104 and :136, then follow the x-pack/lib/geoip_database_management/manager.rb:52 path through logstash-core/lib/logstash/agent.rb. Compare the failing API specs and helpers against the 8.12.0-onwards setting behavior. Done means the listed RSpec failures no longer occur and rubyTests passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, ruby
Domain
backend, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.