Skip to content

Commit 3c30fa7

Browse files
committed
[TEST] Instead of ignoring the ccr downgrade to basic license qa test
avoid the assertions that check the log files, because that does not work on Windows. The rest of the test is still useful and should work on Windows CI. Currently on Windows CI this qa module fails because there is just one test and that test si ignored if OS is Windows.
1 parent 7a739c7 commit 3c30fa7

File tree

1 file changed

+23
-21
lines changed
  • x-pack/plugin/ccr/qa/multi-cluster-downgraded-to-basic-license/src/test/java/org/elasticsearch/xpack/ccr

1 file changed

+23
-21
lines changed

x-pack/plugin/ccr/qa/multi-cluster-downgraded-to-basic-license/src/test/java/org/elasticsearch/xpack/ccr/FollowIndexIT.java

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
public class FollowIndexIT extends ESCCRRestTestCase {
2929

3030
public void testDowngradeRemoteClusterToBasic() throws Exception {
31-
assumeFalse("windows is the worst", Constants.WINDOWS);
3231
if ("follow".equals(targetCluster) == false) {
3332
return;
3433
}
@@ -78,27 +77,30 @@ public void testDowngradeRemoteClusterToBasic() throws Exception {
7877
assertThat(indexExists(index2), is(false));
7978

8079
// parse the logs and ensure that the auto-coordinator skipped coordination on the leader cluster
81-
assertBusy(() -> {
82-
final List<String> lines = Files.readAllLines(PathUtils.get(System.getProperty("log")));
83-
final Iterator<String> it = lines.iterator();
84-
boolean warn = false;
85-
while (it.hasNext()) {
86-
final String line = it.next();
87-
if (line.matches(".*\\[WARN\\s*\\]\\[o\\.e\\.x\\.c\\.a\\.AutoFollowCoordinator\\s*\\] \\[node-0\\] " +
88-
"failure occurred while fetching cluster state for auto follow pattern \\[test_pattern\\]")) {
89-
warn = true;
90-
break;
80+
// (does not work on windows...)
81+
if (Constants.WINDOWS == false) {
82+
assertBusy(() -> {
83+
final List<String> lines = Files.readAllLines(PathUtils.get(System.getProperty("log")));
84+
final Iterator<String> it = lines.iterator();
85+
boolean warn = false;
86+
while (it.hasNext()) {
87+
final String line = it.next();
88+
if (line.matches(".*\\[WARN\\s*\\]\\[o\\.e\\.x\\.c\\.a\\.AutoFollowCoordinator\\s*\\] \\[node-0\\] " +
89+
"failure occurred while fetching cluster state for auto follow pattern \\[test_pattern\\]")) {
90+
warn = true;
91+
break;
92+
}
9193
}
92-
}
93-
assertTrue(warn);
94-
assertTrue(it.hasNext());
95-
final String lineAfterWarn = it.next();
96-
assertThat(
97-
lineAfterWarn,
98-
equalTo("org.elasticsearch.ElasticsearchStatusException: " +
99-
"can not fetch remote cluster state as the remote cluster [leader_cluster] is not licensed for [ccr]; " +
100-
"the license mode [BASIC] on cluster [leader_cluster] does not enable [ccr]"));
101-
});
94+
assertTrue(warn);
95+
assertTrue(it.hasNext());
96+
final String lineAfterWarn = it.next();
97+
assertThat(
98+
lineAfterWarn,
99+
equalTo("org.elasticsearch.ElasticsearchStatusException: " +
100+
"can not fetch remote cluster state as the remote cluster [leader_cluster] is not licensed for [ccr]; " +
101+
"the license mode [BASIC] on cluster [leader_cluster] does not enable [ccr]"));
102+
});
103+
}
102104
});
103105

104106
// Manually following index2 also does not work after the downgrade:

0 commit comments

Comments
 (0)