Skip to content

Commit 63b2db1

Browse files
committed
Test fix - Graph HLRC test was missing field name to be excluded from randomisation logic
Closes #33231
1 parent 4910918 commit 63b2db1

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

x-pack/plugin/core/src/test/java/org/elasticsearch/protocol/xpack/graph/GraphExploreResponseTests.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import org.elasticsearch.ElasticsearchException;
99
import org.elasticsearch.action.ShardOperationFailedException;
1010
import org.elasticsearch.action.search.ShardSearchFailure;
11-
import org.elasticsearch.common.Strings;
1211
import org.elasticsearch.common.xcontent.ToXContent;
1312
import org.elasticsearch.common.xcontent.XContentParser;
1413
import org.elasticsearch.test.AbstractXContentTestCase;
@@ -75,6 +74,11 @@ protected boolean supportsUnknownFields() {
7574
return true;
7675
}
7776

77+
@Override
78+
protected String[] getShuffleFieldsExceptions() {
79+
return new String[]{"vertices"};
80+
}
81+
7882
protected Predicate<String> getRandomFieldsExcludeFilterWhenResultHasErrors() {
7983
return field -> field.startsWith("responses");
8084
}
@@ -110,7 +114,7 @@ public void testFromXContentWithFailures() throws IOException {
110114
boolean supportsUnknownFields = true;
111115
//exceptions are not of the same type whenever parsed back
112116
boolean assertToXContentEquivalence = false;
113-
AbstractXContentTestCase.testFromXContent(NUMBER_OF_TEST_RUNS, instanceSupplier, supportsUnknownFields, Strings.EMPTY_ARRAY,
117+
AbstractXContentTestCase.testFromXContent(NUMBER_OF_TEST_RUNS, instanceSupplier, supportsUnknownFields, getShuffleFieldsExceptions(),
114118
getRandomFieldsExcludeFilterWhenResultHasErrors(), this::createParser, this::doParseInstance,
115119
this::assertEqualInstances, assertToXContentEquivalence, ToXContent.EMPTY_PARAMS);
116120
}

x-pack/protocol/src/test/java/org/elasticsearch/protocol/xpack/graph/GraphExploreResponseTests.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import org.elasticsearch.ElasticsearchException;
2222
import org.elasticsearch.action.ShardOperationFailedException;
2323
import org.elasticsearch.action.search.ShardSearchFailure;
24-
import org.elasticsearch.common.Strings;
2524
import org.elasticsearch.common.xcontent.ToXContent;
2625
import org.elasticsearch.common.xcontent.XContentParser;
2726
import org.elasticsearch.test.AbstractXContentTestCase;
@@ -128,7 +127,7 @@ public void testFromXContentWithFailures() throws IOException {
128127
boolean supportsUnknownFields = true;
129128
//exceptions are not of the same type whenever parsed back
130129
boolean assertToXContentEquivalence = false;
131-
AbstractXContentTestCase.testFromXContent(NUMBER_OF_TEST_RUNS, instanceSupplier, supportsUnknownFields, Strings.EMPTY_ARRAY,
130+
AbstractXContentTestCase.testFromXContent(NUMBER_OF_TEST_RUNS, instanceSupplier, supportsUnknownFields, getShuffleFieldsExceptions(),
132131
getRandomFieldsExcludeFilterWhenResultHasErrors(), this::createParser, this::doParseInstance,
133132
this::assertEqualInstances, assertToXContentEquivalence, ToXContent.EMPTY_PARAMS);
134133
}

0 commit comments

Comments
 (0)