Commit graph

8588 commits

Author SHA1 Message Date
Pier-Hugues Pellerin
8e43ecaf46 Removed a flaky test in agent_spec in favor a refactored one in converge_spec
We remove a flaky test "LogStash::Agent#execute when auto_reload is true if state is clean should periodically reload_state"
in favor of the refactored test in `converge_spec`, since it doesn't use
rspec mock but instead use a threadsafe spies to make sure we do
multiple call on the source loader.

Fixes: #7196

Fixes #7200
2017-05-24 23:50:59 +00:00
DeDe Morton
1ce0af8091 Add changes from review
Fixes #7180
2017-05-24 22:16:33 +00:00
DeDe Morton
9b857fa0de Clarify doc to indicate that offline install expects a file URI
Fixes #7180
2017-05-24 22:16:33 +00:00
Pier-Hugues Pellerin
ef991b65c0 Fix the acceptance on Debian family
This commit fixes an issue when the debian 8 machine was not correctly bootstrapped and made the suite,
We also disable the test introduced by #6879 they need to be redone so they actually test the content fo the generated gem.

Fixes: #7123

Fixes #7187
2017-05-24 14:44:21 +00:00
Wainer dos Santos Moschetta
4163af5bea Add test case for FileLockFactory
This change introduce a test for cross-process/jvm file locking
using the FileLockFactory class. It uses a client program that
will lock a file aftwards the test case proceed.

Fixes #6610

Fixes #7117
2017-05-24 02:20:36 +00:00
Rob Bavey
a170e73571 Fix Javadoc warning
Adds an @return value to fix the JavaDoc error

Fixes #7176
2017-05-22 23:57:20 +00:00
Joao Duarte
30dc1b83a7 fix syntax error in logstash-plugin generate test
Fixes #7182
2017-05-22 18:41:32 +00:00
Andrew Cholakian
bb60eb8f47 Run offline specs separately from online ones.
The internet disabling C hack can break other tests, so, we now run
those tests separately.

Fixes https://github.com/elastic/logstash/issues/7178

Fixes #7179
2017-05-22 15:28:27 +00:00
Joao Duarte
412dd7bc08 add ExpectationNotMetError to Stud.try on monitoring_api_spec
in some tests against metrics api it's possible the values aren't there,
making the assertion fail. By default Stud.try only catches StandardError,
but rspec throws a RSpec::Expectations::ExpectationNotMetError on a failed
assertion, and this exception inherits directly from Exception.

This commit explicitly adds this exception to the list of Stud.try exceptions

Fixes #7177
2017-05-22 13:46:30 +00:00
Rob Bavey
7537b62c8d Fix NoMethodError when Stack Trace is empty
Adds :traces to hash even if traces are empty.

Fixes #7174

Fixes #7175
2017-05-22 13:02:17 +00:00
Joao Duarte
c3df20b7cf protect monitoring_api_spec against timing issues
Fixes #7145
2017-05-21 18:52:14 +00:00
Rob Bavey
3e13b33e44 Move code from JRmonitor into logstash-core #6337
Java code is mostly the same as that from the JRMonitor gem with some general tidying and DRYing up
Report classes are now straight Java
Added junit tests for the Java monitor classes
Ruby code basically stays the same, other than calling out to pure Java report classes

Fixes #7167
2017-05-19 21:09:52 +00:00
Bernd
ec87eb7642 removed unreachable code (#5215) 2017-05-19 11:32:24 -07:00
Suyog Rao
cfecf81091 Only glob *.conf by default in conf.d folder (#7130)
* Only glob *.conf by default in conf.d folder

Fixes #6979, Fixes #1831
2017-05-19 11:26:10 -07:00
Armin
e8b4548ef5 MINOR: Remove dead code from org.logstash.ackedqueue.io.AbstractByteBufferPageIO
Fixes #7169
2017-05-19 18:02:46 +00:00
Armin
7493471063 #7160 don't run Kafka setup for every IT
Fixes #7168
2017-05-19 17:45:10 +00:00
Armin
71dc852b9d MINOR: Prevent leaking threads from QueueTest
Fixes #7163
2017-05-19 10:33:16 +00:00
Armin
9fe4e9b3b7 MINOR: Clean up redundant matchers in QueueTest
Fixes #7161
2017-05-19 08:54:42 +00:00
Armin
b7f4fd7ebf Cleanup Queue not being safely closed in QueueTest
Fixes #7063
2017-05-19 05:04:37 +00:00
Armin
64397c66e3 Fix FD leak in FileCheckpointIO, closes #7150
Fixes #7151
2017-05-18 18:35:44 +00:00
Pier-Hugues Pellerin
b00b7f9656 Prevent variable leak between test
When running this test with a newer version of rspec we got the warning
that some values where leaking between example:

```
 1) LogStash::ShutdownWatcher when pipeline is not stalled .unsafe_shutdown = false shouldn't force the shutdown
     Failure/Error: m.call(*args)
       The use of doubles or partial doubles from rspec-mocks outside of the per-test lifecycle is not supported.
     # ./logstash-core/lib/logstash/shutdown_watcher.rb:67:in `pipeline_report_snapshot'
     # ./logstash-core/spec/logstash/shutdown_watcher_spec.rb:22:in `block in /Users/ph/es/second/logstash/logstash-core/spec/logstash/shutdown_watcher_spec.rb'
     # ./logstash-core/lib/logstash/shutdown_watcher.rb:44:in `block in start'
     # ./vendor/bundle/jruby/2.3.0/gems/stud-0.0.22/lib/stud/interval.rb:20:in `interval'
     # ./logstash-core/lib/logstash/shutdown_watcher.rb:42:in `start'
     # ./logstash-core/spec/logstash/shutdown_watcher_spec.rb:93:in `block in (root)'
```

We have added a few helpers method in the class that allowed us to
simplify the expectation and removed any usage of `Thread#kill`

Fixes #7152
2017-05-18 17:07:23 +00:00
Armin
1a2c0c8597 #7053 Refactor Queue Settings Class to Using a Builder Pattern
Fixes #7062
2017-05-18 15:57:43 +00:00
Andrew Cholakian
78f70634ed Refactor API specs to play well with others
This is a big chang, it:

1. Moves API specs out of their special hierarchy
2. Removes the API spec spec_helper
3. Reactivates that stats command spec (that was accidentally not being
run before due to it not having _spec as a suffix

This was required to fix the preceeding commit, where we added a
before(:each) hook to the spec_helper that wasn't being picked up in
some cases due to the existence of two spec helpers and a $LOAD_PATH
that could change.

Fixes #7132
2017-05-18 13:45:27 +00:00
Andrew Cholakian
ff222b668b Clean settings before *and* after spec runs for the runner just in case.
This is a bit belt and suspenders, but I'm out of ideas for #6737 .
Its a bit worrying that the test cleanup may not be working correctly

Fixes #7132
2017-05-18 13:45:27 +00:00
Joao Duarte
8b2490bad8 fix failing test due to faulty api request
fixes https://github.com/elastic/logstash/issues/7086

Fixes #7144
2017-05-18 11:00:27 +00:00
Armin
b6c855a0a6 Added JMH Benchmark Suite + Queue Benchmark
Fixes #7118
2017-05-18 06:31:17 +00:00
Armin
b3c4f343f6 MINOR: Cleanup some inefficient List usage
Fixes #7143
2017-05-18 05:20:19 +00:00
Andrew Cholakian
b595b54362 Move rake test:* tasks to all use bin/rspec.
This eliminates the differences in behavior between bin/rspec and rake
test:*

Fixes #7140
2017-05-17 19:53:53 +00:00
Armin
4863621840 MINOR: Removed dead fields from Event
Fixes #7139
2017-05-17 18:16:28 +00:00
Andrew Cholakian
7e9529fe47 Make test for pipeline flushing more resilient.
Instead of depending on the now deprecated multiline filter we use a
dummy filter that just emits events. This simplifies the test and
dramatically reduces timing issues.

I also increased the max-wait for the timer just in case

Fixes #7024

Fixes #7131
2017-05-17 13:57:13 +00:00
Armin
0c282105eb #7087 Fixed unstable test from premature exit of user defined pipeline
Fixes #7133
2017-05-17 13:09:35 +00:00
Armin
f0302f100d Added note on Docker dependency to IT Readme
Fixes #7134
2017-05-17 12:07:18 +00:00
Pier-Hugues Pellerin
f6c89ae55d Use --format documentation when tests are running on travis
We have decided to increase the verbosity of the test on travis to help debug some weird errors in the suite

Fixes #7064
2017-05-16 18:02:10 +00:00
Andrew Cholakian
879451c964 Remove `mean' metric type.
The central problem with recording a mean stat is that on a non-realtime
system you can't guarantee that samples were evenly spaced out. A series
of timestamped gauges does a better job. This is what we can do in our
x-pack monitoring extension, but not something we should do in core. The
central difference is that x-pack has Elasticsearch, which can act as a
time series database. I'd prefer not to build a tsdb into logstash. That
would obviously involve a lot of complexity.

Fixes #7094.

Fixes #7105
2017-05-16 17:45:10 +00:00
Andrew Cholakian
5cd9cba3ee Use the headless JRE for the kafka docker image
Fixes #7107
2017-05-16 17:44:01 +00:00
Rob Bavey
06823be008 Fix test failure when run from DNS hijacked ISP
Removes the tld from 'unreachable host' to circumvent DNS hijacking
ISPs returning a 200 response for non-existent domains.

Fixes #7124
2017-05-16 17:41:34 +00:00
Pier-Hugues Pellerin
90432f5265 Relax the Geoip filter test
Since the database of the plugin can be update we cannot do a strict
assert on the geoip lat/long values instead we will use a range of
possible and valid latitude and longitude.

Fixes: #7119

Fixes #7122
2017-05-16 17:36:33 +00:00
Armin
66f0b52318 Fix broken Gradle tests
Fixes #7114
2017-05-16 15:59:34 +00:00
Pier-Hugues Pellerin
c9700220bd consistency in naming
Fixes #7103
2017-05-16 14:20:34 +00:00
Pier-Hugues Pellerin
23d0b34b53 Make the test for the write WrappedWriteClient more robust
Instead of using sleep we start two threads and we join them to do the
expectation.

Fixes: #7031 #7032

Fixes #7103
2017-05-16 14:20:33 +00:00
Andrew Cholakian
558e3e9575 Make gradle assemble the default compile:all command.
This well help catch javadoc errors during dev + build

Fixes #7108
2017-05-15 21:36:25 +00:00
Andrew Cholakian
ab6fd09df4 Fix broken javadoc comments in DLQ code
These broken comments were breaking javadoc generation

Fixes #7108
2017-05-15 21:36:25 +00:00
Andrew Cholakian
1187d03eb7 Run gradle tests in 'info' mode to log failures
Fixes #7110
2017-05-15 21:18:58 +00:00
Andrew Cholakian
c1ac7e9add Pin rack version to avoid ruby2.0 only features
We can't run the latest rack without JRuby 9k unfortunately

Fixes #7110
2017-05-15 21:18:58 +00:00
Armin
9cc830fdf1 Minor: Stop allocating byte[] to compute crc32
Fixes #7058
2017-05-15 20:07:12 +00:00
Armin
4994bf3bc5 #7043 run gradle tests in core specs and document running gradle tests only in readme
Fixes #7099
2017-05-15 15:58:45 +00:00
Armin
2ac72226d3 #7091 Dockerized Kafka IT fixture
Fixes #7093
2017-05-13 22:46:24 +00:00
Armin
0aea12ce00 #7081 fix portability issues with Kafka Broker IPV4 and log path creation
Fixes #7092
2017-05-12 18:06:34 +00:00
Armin
af16ed5a88 #7081 up Kafka IT version to 0.10.2.1
Fixes #7088
2017-05-12 16:53:49 +00:00
Armin
cffabc7a59 #7083 document logstash.yml ENV interpolation
Fixes #7084
2017-05-12 11:07:24 +00:00