Skip to content

Commit

Permalink
Fix flaky test RemoteStoreIT.testRemoteSegmentStoreRestore (#6252) (#…
Browse files Browse the repository at this point in the history
…6265)

(cherry picked from commit 4f5fd9c)
Signed-off-by: Sachin Kale <[email protected]>
  • Loading branch information
opensearch-trigger-bot[bot] authored Feb 9, 2023
1 parent 509f786 commit c0411f3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ private IndexResponse indexSingleDoc() {
private Map<String, Long> indexData() {
long totalOperations = 0;
long refreshedOrFlushedOperations = 0;
long maxSeqNo = 0;
long maxSeqNoRefreshedOrFlushed = 0;
long maxSeqNo = -1;
long maxSeqNoRefreshedOrFlushed = -1;
for (int i = 0; i < randomIntBetween(1, 10); i++) {
if (randomBoolean()) {
flush(INDEX_NAME);
Expand Down Expand Up @@ -150,8 +150,8 @@ private void verifyRestoredData(Map<String, Long> indexStats, boolean checkTotal
assertHitCount(client().prepareSearch(INDEX_NAME).setSize(0).get(), indexStats.get(statsGranularity) + 1);
}

public void testRemoteStoreRestoreFromRemoteSegmentStore() throws IOException {
internalCluster().startNodes(3);
public void testRemoteSegmentStoreRestore() throws IOException {
internalCluster().startDataOnlyNodes(3);
createIndex(INDEX_NAME, remoteStoreIndexSettings(0));
ensureYellowAndNoInitializingShards(INDEX_NAME);
ensureGreen(INDEX_NAME);
Expand All @@ -169,7 +169,7 @@ public void testRemoteStoreRestoreFromRemoteSegmentStore() throws IOException {

@AwaitsFix(bugUrl = "https://github.com/opensearch-project/OpenSearch/issues/6188")
public void testRemoteTranslogRestore() throws IOException {
internalCluster().startNodes(3);
internalCluster().startDataOnlyNodes(3);
createIndex(INDEX_NAME, remoteTranslogIndexSettings(0));
ensureYellowAndNoInitializingShards(INDEX_NAME);
ensureGreen(INDEX_NAME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -804,9 +804,8 @@ public void testMultiGetWithNetworkDisruption_FailOpenDisabled() throws Exceptio

/**
* Assert that preference based search is not allowed with strict weighted shard routing
* @throws Exception throws exception
*/
public void testStrictWeightedRouting() throws Exception {
public void testStrictWeightedRouting() {

Settings commonSettings = Settings.builder()
.put("cluster.routing.allocation.awareness.attributes", "zone")
Expand Down Expand Up @@ -841,9 +840,8 @@ public void testStrictWeightedRouting() throws Exception {

/**
* Assert that preference based search works with non-strict weighted shard routing
* @throws Exception
*/
public void testPreferenceSearchWithWeightedRouting() throws Exception {
public void testPreferenceSearchWithWeightedRouting() {
Settings commonSettings = Settings.builder()
.put("cluster.routing.allocation.awareness.attributes", "zone")
.put("cluster.routing.allocation.awareness.force.zone.values", "a,b,c")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,6 @@ public void testNumDocs() throws IOException {
/**
* Tests whether old segments are readable and queryable based on the data documented
* in the README <a href="file:../../../../../resources/indices/bwc/es-6.3.0/README.md">here</a>.
*
* @throws IOException
*/
public void testReadSegmentInfosExtendedCompatibility() throws IOException {
final String pathToTestIndex = "/indices/bwc/es-6.3.0/testIndex-es-6.3.0.zip";
Expand Down

0 comments on commit c0411f3

Please sign in to comment.