Skip to content

Commit

Permalink
Bug Fix Rolling Upgrade
Browse files Browse the repository at this point in the history
Signed-off-by: Varun Jain <[email protected]>
  • Loading branch information
vibrantvarun committed Dec 21, 2023
1 parent 723fc13 commit 975eaea
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
matrix:
java: [ 11, 17, 21 ]
os: [ubuntu-latest,windows-latest]
bwc_version: [ "2.9.0", "2.10.0", "2.11.0","2.12.0-SNAPSHOT" ]
bwc_version: [ "2.12.0-SNAPSHOT" ]
opensearch_version: [ "3.0.0-SNAPSHOT" ]

name: NeuralSearch Rolling-Upgrade BWC Tests
Expand Down
3 changes: 2 additions & 1 deletion qa/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ task deletetempDirectories {
}

task pullMlCommonsBwcPlugin {
//dependsOn "deletetempDirectories"
doLast {
copy {
from(java.nio.file.Path.of(tmp_dir.absolutePath, "opensearch-${neural_search_bwc_version_no_qualifier}", "plugins", "opensearch-ml"))
Expand Down Expand Up @@ -122,7 +123,7 @@ task pullKnnBwcPlugin {

// Task to pull neural search plugin from archive
task pullBwcPlugin {

//dependsOn "deletetempDirectories"
doLast {
copy {
from(java.nio.file.Path.of(tmp_dir.absolutePath, "opensearch-${neural_search_bwc_version_no_qualifier}", "plugins", "opensearch-neural-search"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,9 @@
import com.carrotsearch.randomizedtesting.RandomizedTest;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
import java.util.Map;
import org.opensearch.client.Request;
import org.opensearch.client.Response;

import static org.opensearch.neuralsearch.TestUtils.NODES_BWC_CLUSTER;
import org.opensearch.neuralsearch.query.NeuralQueryBuilder;

public class TextSearch extends AbstractRestartUpgradeRestTestCase{

Expand Down Expand Up @@ -45,13 +41,6 @@ public void testIndex() throws Exception{
private void validateTestIndex() throws Exception {
int docCount=getDocCount(testIndex);
assertEquals(1,docCount);
NeuralQueryBuilder neuralQueryBuilder = new NeuralQueryBuilder();
neuralQueryBuilder.fieldName(TEST_FIELD);
neuralQueryBuilder.queryText(TEXT);
neuralQueryBuilder.k(1);
Map<String, Object> searchResponseAsMap = search(testIndex,neuralQueryBuilder,1);
Map<String, Object> total = getTotalHits(searchResponseAsMap);
assertNotNull(total.get("value"));
deleteIndex(testIndex);
}

Expand Down
8 changes: 4 additions & 4 deletions qa/rolling-upgrade/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ task testAgainstOldCluster(type: StandaloneRestIntegTestTask) {
// Part of rolling upgrade. Upgrades one node of the old cluster to new OpenSearch version with upgraded plugin version
// This results in a mixed cluster with 2 nodes on the old version and 1 upgraded node.
task testAgainstOneThirdUpgradedCluster(type: StandaloneRestIntegTestTask) {
dependsOn "testAgainstOldCluster"
useCluster testClusters."${baseName}"
dependsOn rootProject.tasks.assemble
dependsOn "testAgainstOldCluster"
doFirst {
testClusters."${baseName}".getNodes().getAt("${baseName}" + "-0").environment("LD_LIBRARY_PATH", "$rootDir/jni/release")
testClusters."${baseName}".getNodes().getAt("${baseName}" + "-0").systemProperty("java.library.path", "$rootDir/jni/release")
testClusters."${baseName}".getNodes().getAt("${baseName}" + "-0").upgradeNodeAndPluginToNextVersion(plugins)
testClusters."${baseName}".upgradeNodeAndPluginToNextVersion(plugins)
}
systemProperty 'tests.rest.bwcsuite_cluster', 'mixed_cluster'
systemProperty 'tests.rest.first_round', 'true'
Expand All @@ -103,7 +103,7 @@ task testAgainstTwoThirdsUpgradedCluster(type: StandaloneRestIntegTestTask) {
doFirst {
testClusters."${baseName}".getNodes().getAt("${baseName}" + "-1").environment("LD_LIBRARY_PATH", "$rootDir/jni/release")
testClusters."${baseName}".getNodes().getAt("${baseName}" + "-1").systemProperty("java.library.path", "$rootDir/jni/release")
testClusters."${baseName}".getNodes().getAt("${baseName}" + "-1").upgradeNodeAndPluginToNextVersion(plugins)
testClusters."${baseName}".upgradeNodeAndPluginToNextVersion(plugins)
}
systemProperty 'tests.rest.bwcsuite_cluster', 'mixed_cluster'
systemProperty 'tests.rest.first_round', 'false'
Expand All @@ -122,7 +122,7 @@ task testRollingUpgrade(type: StandaloneRestIntegTestTask) {
doFirst {
testClusters."${baseName}".getNodes().getAt("${baseName}" + "-2").environment("LD_LIBRARY_PATH", "$rootDir/jni/release")
testClusters."${baseName}".getNodes().getAt("${baseName}" + "-2").systemProperty("java.library.path", "$rootDir/jni/release")
testClusters."${baseName}".getNodes().getAt("${baseName}" + "-2").upgradeNodeAndPluginToNextVersion(plugins)
testClusters."${baseName}".upgradeNodeAndPluginToNextVersion(plugins)
}
mustRunAfter "testAgainstOneThirdUpgradedCluster"
systemProperty 'tests.rest.bwcsuite_cluster', 'upgraded_cluster'
Expand Down

0 comments on commit 975eaea

Please sign in to comment.