Skip to content

Commit 7544c88

Browse files
authored
Consolidate @before of rolling upgrade tests (#114677)
Multiple @before methods in junit are run in random order. This commit cosolidates the @before methods of ParameterizedRollingUpgradeTestCase since the code has interdependencies. closes #114330
1 parent 06a3e19 commit 7544c88

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

qa/rolling-upgrade/src/javaRestTest/java/org/elasticsearch/upgrades/ParameterizedRollingUpgradeTestCase.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,13 @@ public static Iterable<Object[]> parameters() {
5555
protected abstract ElasticsearchCluster getUpgradeCluster();
5656

5757
@Before
58-
public void extractOldClusterFeatures() {
58+
public void upgradeNode() throws Exception {
59+
// extract old cluster features
5960
if (isOldCluster() && oldClusterTestFeatureService == null) {
6061
oldClusterTestFeatureService = testFeatureService;
6162
}
62-
}
6363

64-
@Before
65-
public void extractOldIndexVersion() throws Exception {
64+
// extract old index version
6665
if (oldIndexVersion == null && upgradedNodes.isEmpty()) {
6766
IndexVersion indexVersion = null; // these should all be the same version
6867

@@ -93,13 +92,11 @@ public void extractOldIndexVersion() throws Exception {
9392
assertThat("Index version could not be read", indexVersion, notNullValue());
9493
oldIndexVersion = indexVersion;
9594
}
96-
}
9795

98-
@Before
99-
public void upgradeNode() throws Exception {
10096
// Skip remaining tests if upgrade failed
10197
assumeFalse("Cluster upgrade failed", upgradeFailed);
10298

99+
// finally, upgrade node
103100
if (upgradedNodes.size() < requestedUpgradedNodes) {
104101
closeClients();
105102
// we might be running a specific upgrade test by itself - check previous nodes too

0 commit comments

Comments
 (0)