mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
Backport #12009 to 7.x branch, bugfix in pipeline reload
fix Settings equality test which broke the PipelineConfig equality
This commit is contained in:
parent
41272371a5
commit
659ef33f72
2 changed files with 6 additions and 2 deletions
|
@ -126,7 +126,7 @@ public final class PipelineConfig {
|
||||||
PipelineConfig cother = (PipelineConfig) other;
|
PipelineConfig cother = (PipelineConfig) other;
|
||||||
return configHash().equals(cother.configHash()) &&
|
return configHash().equals(cother.configHash()) &&
|
||||||
this.pipelineId.equals(cother.pipelineId) &&
|
this.pipelineId.equals(cother.pipelineId) &&
|
||||||
this.settings.eql(cother.settings);
|
this.settings.equals(cother.settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -44,7 +44,7 @@ public class PipelineConfigTest extends RubyEnvTestCase {
|
||||||
private final static RubyObject SETTINGS = (RubyObject) RubyUtil.RUBY.evalScriptlet(
|
private final static RubyObject SETTINGS = (RubyObject) RubyUtil.RUBY.evalScriptlet(
|
||||||
"require 'logstash/environment'\n" + // this is needed to register "pipeline.system" setting
|
"require 'logstash/environment'\n" + // this is needed to register "pipeline.system" setting
|
||||||
"require 'logstash/settings'\n" +
|
"require 'logstash/settings'\n" +
|
||||||
"LogStash::SETTINGS");;
|
"LogStash::SETTINGS");
|
||||||
private PipelineConfig sut;
|
private PipelineConfig sut;
|
||||||
private SourceWithMetadata[] orderedConfigParts;
|
private SourceWithMetadata[] orderedConfigParts;
|
||||||
public static final String PIPELINE_CONFIG_PART_2 =
|
public static final String PIPELINE_CONFIG_PART_2 =
|
||||||
|
@ -101,6 +101,10 @@ public class PipelineConfigTest extends RubyEnvTestCase {
|
||||||
PipelineConfig anotherExactPipeline = new PipelineConfig(source, pipelineIdSym, toRubyArray(orderedConfigParts), SETTINGS);
|
PipelineConfig anotherExactPipeline = new PipelineConfig(source, pipelineIdSym, toRubyArray(orderedConfigParts), SETTINGS);
|
||||||
assertEquals(anotherExactPipeline, sut);
|
assertEquals(anotherExactPipeline, sut);
|
||||||
|
|
||||||
|
final RubyObject CLONED_SETTINGS = (RubyObject)SETTINGS.callMethod("clone");
|
||||||
|
PipelineConfig anotherExactPipelineWithClonedSettings = new PipelineConfig(source, pipelineIdSym, toRubyArray(orderedConfigParts), CLONED_SETTINGS);
|
||||||
|
assertEquals(anotherExactPipelineWithClonedSettings, sut);
|
||||||
|
|
||||||
PipelineConfig notMatchingPipeline = new PipelineConfig(source, pipelineIdSym, RubyArray.newEmptyArray(RubyUtil.RUBY), SETTINGS);
|
PipelineConfig notMatchingPipeline = new PipelineConfig(source, pipelineIdSym, RubyArray.newEmptyArray(RubyUtil.RUBY), SETTINGS);
|
||||||
assertNotEquals(notMatchingPipeline, sut);
|
assertNotEquals(notMatchingPipeline, sut);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue