This is an automated email from the ASF dual-hosted git repository.
erose pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git
The following commit(s) were added to refs/heads/master by this push:
new 9044a773d8 HDDS-13346. Intermittent failure in
TestCloseContainer#testContainerChecksumForClosedContainer (#8771)
9044a773d8 is described below
commit 9044a773d83fc4c765485089c98f757125d6fa27
Author: Aswin Shakil Balasubramanian <[email protected]>
AuthorDate: Tue Jul 15 17:42:02 2025 -0700
HDDS-13346. Intermittent failure in
TestCloseContainer#testContainerChecksumForClosedContainer (#8771)
---
.../apache/hadoop/hdds/scm/TestCloseContainer.java | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git
a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestCloseContainer.java
b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestCloseContainer.java
index 99cbde901c..7910b6908c 100644
---
a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestCloseContainer.java
+++
b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestCloseContainer.java
@@ -229,8 +229,8 @@ public void testContainerChecksumForClosedContainer()
throws Exception {
// Checksum file exists after container close and matches the expected
container
// merkle tree for all the datanodes
for (HddsDatanodeService hddsDatanode : hddsDatanodes) {
- GenericTestUtils.waitFor(() ->
checkContainerCloseInDatanode(hddsDatanode, containerInfo1), 100, 5000);
- assertTrue(containerChecksumFileExists(hddsDatanode,
containerInfo1.getContainerID()));
+ GenericTestUtils.waitFor(() ->
checkContainerCloseInDatanode(hddsDatanode, containerInfo1) &&
+ containerChecksumFileExists(hddsDatanode,
containerInfo1.getContainerID()), 100, 5000);
OzoneContainer ozoneContainer =
hddsDatanode.getDatanodeStateMachine().getContainer();
Container<?> container1 =
ozoneContainer.getController().getContainer(containerInfo1.getContainerID());
ContainerProtos.ContainerChecksumInfo containerChecksumInfo =
ContainerMerkleTreeTestUtils.readChecksumFile(
@@ -256,8 +256,8 @@ public void testContainerChecksumForClosedContainer()
throws Exception {
// Checksum file exists after container close and matches the expected
container
// merkle tree for all the datanodes
for (HddsDatanodeService hddsDatanode : hddsDatanodes) {
- GenericTestUtils.waitFor(() ->
checkContainerCloseInDatanode(hddsDatanode, containerInfo2), 100, 5000);
- assertTrue(containerChecksumFileExists(hddsDatanode,
containerInfo2.getContainerID()));
+ GenericTestUtils.waitFor(() ->
checkContainerCloseInDatanode(hddsDatanode, containerInfo2) &&
+ containerChecksumFileExists(hddsDatanode,
containerInfo2.getContainerID()), 100, 5000);
OzoneContainer ozoneContainer =
hddsDatanode.getDatanodeStateMachine().getContainer();
Container<?> container2 =
ozoneContainer.getController().getContainer(containerInfo2.getContainerID());
ContainerProtos.ContainerChecksumInfo containerChecksumInfo =
ContainerMerkleTreeTestUtils.readChecksumFile(
@@ -274,12 +274,12 @@ public void testContainerChecksumForClosedContainer()
throws Exception {
assertNotEquals(prevExpectedChecksumInfo1.getContainerID(),
prevExpectedChecksumInfo2.getContainerID());
assertNotEquals(prevExpectedChecksumInfo1.getContainerMerkleTree().getDataChecksum(),
prevExpectedChecksumInfo2.getContainerMerkleTree().getDataChecksum());
- for (ContainerReplica replica : getContainerReplicas(containerInfo1)) {
- assertNotEquals(0, replica.getDataChecksum());
- }
- for (ContainerReplica replica : getContainerReplicas(containerInfo2)) {
- assertNotEquals(0, replica.getDataChecksum());
- }
+
+ // Wait for SCM to receive container reports with non-zero checksums for
all replicas
+ GenericTestUtils.waitFor(() ->
getContainerReplicas(containerInfo1).stream()
+ .allMatch(r -> r.getDataChecksum() != 0), 200, 5000);
+ GenericTestUtils.waitFor(() ->
getContainerReplicas(containerInfo2).stream()
+ .allMatch(r -> r.getDataChecksum() != 0), 200, 5000);
}
private boolean checkContainerCloseInDatanode(HddsDatanodeService
hddsDatanode,
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]