Skip to content

Commit

Permalink
HDDS-11325. (addendum) Intermittent failure in TestBlockOutputStreamW…
Browse files Browse the repository at this point in the history
…ithFailures#testContainerClose (apache#7121)
  • Loading branch information
jojochuang authored Aug 28, 2024
1 parent 8306290 commit 3bd237d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
import org.apache.hadoop.ozone.client.io.OzoneOutputStream;
import org.apache.hadoop.ozone.container.TestHelper;

import org.apache.ozone.test.tag.Flaky;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.TestInstance;
Expand Down Expand Up @@ -662,7 +661,6 @@ void testWriteExactlyMaxFlushSize(boolean flushDelay, boolean enablePiggybacking

@ParameterizedTest
@MethodSource("clientParameters")
@Flaky("HDDS-11325")
void testWriteMoreThanMaxFlushSize(boolean flushDelay, boolean enablePiggybacking) throws Exception {
OzoneClientConfig config = newClientConfig(cluster.getConf(), flushDelay, enablePiggybacking);
try (OzoneClient client = newClient(cluster.getConf(), config)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ private static Stream<Arguments> clientParameters() {

@ParameterizedTest
@MethodSource("clientParameters")
@Flaky("HDDS-11325")
void testContainerClose(boolean flushDelay, boolean enablePiggybacking) throws Exception {
OzoneClientConfig config = newClientConfig(cluster.getConf(), flushDelay, enablePiggybacking);
try (OzoneClient client = newClient(cluster.getConf(), config)) {
Expand Down Expand Up @@ -386,7 +385,8 @@ private void testWriteMoreThanMaxFlushSize(OzoneClient client)
assertInstanceOf(RatisBlockOutputStream.class,
keyOutputStream.getStreamEntries().get(0).getOutputStream());

assertEquals(4, blockOutputStream.getBufferPool().getSize());
assertThat(blockOutputStream.getBufferPool().getSize())
.isLessThanOrEqualTo(4);
assertEquals(dataLength, blockOutputStream.getWrittenDataLength());

assertEquals(400, blockOutputStream.getTotalDataFlushedLength());
Expand Down Expand Up @@ -442,7 +442,8 @@ private void testExceptionDuringClose(OzoneClient client) throws Exception {
assertInstanceOf(RatisBlockOutputStream.class,
keyOutputStream.getStreamEntries().get(0).getOutputStream());

assertEquals(2, blockOutputStream.getBufferPool().getSize());
assertThat(blockOutputStream.getBufferPool().getSize())
.isLessThanOrEqualTo(2);
assertEquals(dataLength, blockOutputStream.getWrittenDataLength());

assertEquals(0, blockOutputStream.getTotalDataFlushedLength());
Expand All @@ -455,7 +456,8 @@ private void testExceptionDuringClose(OzoneClient client) throws Exception {
// Since the data in the buffer is already flushed, flush here will have
// no impact on the counters and data structures

assertEquals(2, blockOutputStream.getBufferPool().getSize());
assertThat(blockOutputStream.getBufferPool().getSize())
.isLessThanOrEqualTo(2);
assertEquals(dataLength, blockOutputStream.getWrittenDataLength());

assertEquals(dataLength, blockOutputStream.getTotalDataFlushedLength());
Expand Down Expand Up @@ -506,9 +508,10 @@ private void testWatchForCommitWithSingleNodeRatis(OzoneClient client)
keyOutputStream.getStreamEntries().get(0).getOutputStream());

// we have just written data more than flush Size(2 chunks), at this time
// buffer pool will have 4 buffers allocated worth of chunk size
// buffer pool will have up to 4 buffers allocated worth of chunk size

assertEquals(4, blockOutputStream.getBufferPool().getSize());
assertThat(blockOutputStream.getBufferPool().getSize())
.isLessThanOrEqualTo(4);
// writtenDataLength as well flushedDataLength will be updated here
assertEquals(dataLength, blockOutputStream.getWrittenDataLength());

Expand All @@ -531,7 +534,8 @@ private void testWatchForCommitWithSingleNodeRatis(OzoneClient client)
// Since the data in the buffer is already flushed, flush here will have
// no impact on the counters and data structures

assertEquals(4, blockOutputStream.getBufferPool().getSize());
assertThat(blockOutputStream.getBufferPool().getSize())
.isLessThanOrEqualTo(4);
assertEquals(dataLength, blockOutputStream.getWrittenDataLength());

assertEquals(dataLength, blockOutputStream.getTotalDataFlushedLength());
Expand Down

0 comments on commit 3bd237d

Please sign in to comment.