Skip to content

Commit

Permalink
Fixed robot and integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
devabhishekpal committed Dec 31, 2024
1 parent 8c45af6 commit d8c0c41
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ Validate Counters for Specific Task
${task} = Get From List ${task_list} 0

# Validate success and failure counters
Should Be Greater Than Or Equal As Integers ${task["successes"]} 0
Should Be Greater Than Or Equal As Integers ${task["failures"]} 0
Should Be True ${task["successes"]}>=0
Should Be True ${task["failures"]}>=0

# Validate table fields
Should Not Be None ${task["lastUpdatedTimestamp"]}
Expand All @@ -104,6 +104,6 @@ Validate All Tasks Updated After Sync
FOR ${task} IN @{tasks}
Should Not Be None ${task["lastUpdatedTimestamp"]}
Should Not Be None ${task["lastUpdatedSeqNumber"]}
Should Be Greater Than Or Equal As Integers ${task["successes"]} 0
Should Be Greater Than Or Equal As Integers ${task["failures"]} 0
Should Be True ${task["successes"]}>=0
Should Be True ${task["failures"]}>=0
END
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import static org.apache.hadoop.ozone.recon.ReconServerConfigKeys.RECON_OM_DELTA_UPDATE_LOOP_LIMIT;
import static org.apache.hadoop.ozone.recon.spi.impl.OzoneManagerServiceProviderImpl.OmSnapshotTaskName.OmDeltaRequest;
import static org.apache.hadoop.ozone.recon.spi.impl.OzoneManagerServiceProviderImpl.OmSnapshotTaskName.OmSnapshotRequest;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.slf4j.event.Level.INFO;
Expand Down Expand Up @@ -69,6 +70,7 @@

import org.apache.ozone.test.GenericTestUtils;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Timeout;
Expand Down Expand Up @@ -255,8 +257,7 @@ public void testOmDBSyncing() throws Exception {
"lastUpdatedTimestamp");

// verify only Delta updates were added to recon after restart.
assertEquals(beforeRestartSnapShotTimeStamp,
afterRestartSnapShotTimeStamp);
assertThat(beforeRestartSnapShotTimeStamp).isGreaterThanOrEqualTo(afterRestartSnapShotTimeStamp);

//verify sequence number after Delta Updates
assertEquals(omLatestSeqNumber, reconLatestSeqNumber);
Expand Down Expand Up @@ -357,12 +358,16 @@ public void testOmDBSyncWithSeqNumberMismatch() throws Exception {
((RDBStore) reconMetadataManagerInstance.getStore()).getDb()
.getLatestSequenceNumber();
assertEquals(0, metrics.getSequenceNumberLag());
omLatestSeqNumber = ((RDBStore) metadataManager.getStore())
.getDb().getLatestSequenceNumber();
assertEquals(omLatestSeqNumber, reconLatestSeqNumber);
impl.syncDataFromOM();
reconLatestSeqNumber =
((RDBStore) reconMetadataManagerInstance.getStore()).getDb()
.getLatestSequenceNumber();
omLatestSeqNumber = ((RDBStore) metadataManager.getStore())
.getDb().getLatestSequenceNumber();
assertEquals(omLatestSeqNumber, reconLatestSeqNumber);
impl.syncDataFromOM();
assertTrue(omServiceProviderImplLogs.getOutput()
.contains("isDBUpdateSuccess: true"));
}
Expand Down

0 comments on commit d8c0c41

Please sign in to comment.