Skip to content

Commit 227c0d8

Browse files
authored
Update container acceptance tests with stdout/stderr changes (#17138)
In #17125 jvm setup was redirected to stderr to avoid polluting stdout. This test was actually having to do some additional processing to parse that information. Now that we have split the destinations the tests can be simplified to look for the data they are trying to validate on the appropriate stream.
1 parent 91258c3 commit 227c0d8

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

qa/docker/shared_examples/container.rb

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,13 @@
1515

1616
it 'should run with the correct version' do
1717
console_out = exec_in_container(@container, 'logstash --version')
18-
console_filtered = console_out.split("\n")
19-
.delete_if do |line|
20-
line =~ /Using LS_JAVA_HOME defined java|Using system java: /
21-
end.join
22-
expect(console_filtered).to match /#{version}/
18+
expect(console_out).to match /#{version}/
2319
end
2420

2521
it 'should run with the bundled JDK' do
26-
first_console_line = exec_in_container(@container, 'logstash --version').split("\n")[0]
27-
expect(first_console_line).to match /Using bundled JDK: \/usr\/share\/logstash\/jdk/
22+
full_command = exec_in_container_full(@container, 'logstash --version')
23+
std_err = full_command[:stderr].join.chomp.strip
24+
expect(std_err).to match /Using bundled JDK: \/usr\/share\/logstash\/jdk/
2825
end
2926

3027
it 'should be running an API server on port 9600' do

0 commit comments

Comments
 (0)