Skip to content

Commit c8e77f8

Browse files
authored
HDDS-12602. Intermittent failure in TestContainerStateMachine.testWriteFailure (apache#8099)
1 parent 08ac32d commit c8e77f8

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/transport/server/ratis/TestContainerStateMachine.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ public void testWriteFailure(boolean failWithException) throws ExecutionExceptio
123123
RaftProtos.LogEntryProto entry = mock(RaftProtos.LogEntryProto.class);
124124
when(entry.getTerm()).thenReturn(1L);
125125
when(entry.getIndex()).thenReturn(1L);
126+
RaftProtos.LogEntryProto entryNext = mock(RaftProtos.LogEntryProto.class);
127+
when(entryNext.getTerm()).thenReturn(1L);
128+
when(entryNext.getIndex()).thenReturn(2L);
126129
TransactionContext trx = mock(TransactionContext.class);
127130
ContainerStateMachine.Context context = mock(ContainerStateMachine.Context.class);
128131
when(trx.getStateMachineContext()).thenReturn(context);
@@ -167,7 +170,7 @@ public void testWriteFailure(boolean failWithException) throws ExecutionExceptio
167170
ContainerProtos.DatanodeBlockID.newBuilder().setContainerID(2).setLocalID(1).build()).build())
168171
.setContainerID(2)
169172
.setDatanodeUuid(UUID.randomUUID().toString()).build());
170-
stateMachine.write(entry, trx).exceptionally(throwableSetter).get();
173+
stateMachine.write(entryNext, trx).exceptionally(throwableSetter).get();
171174
verify(dispatcher, times(0)).dispatch(any(ContainerProtos.ContainerCommandRequestProto.class),
172175
any(DispatcherContext.class));
173176
assertInstanceOf(StorageContainerException.class, throwable.get());

hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/transport/server/ratis/TestContainerStateMachineFollower.java

-3
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,9 @@
1717

1818
package org.apache.hadoop.ozone.container.common.transport.server.ratis;
1919

20-
import org.apache.ozone.test.tag.Flaky;
21-
2220
/**
2321
* Test class to ContainerStateMachine class for follower.
2422
*/
25-
@Flaky("HDDS-12602")
2623
public class TestContainerStateMachineFollower extends TestContainerStateMachine {
2724
public TestContainerStateMachineFollower() {
2825
super(false);

hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/transport/server/ratis/TestContainerStateMachineLeader.java

-3
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,9 @@
1717

1818
package org.apache.hadoop.ozone.container.common.transport.server.ratis;
1919

20-
import org.apache.ozone.test.tag.Flaky;
21-
2220
/**
2321
* Test class to ContainerStateMachine class for leader.
2422
*/
25-
@Flaky("HDDS-12602")
2623
public class TestContainerStateMachineLeader extends TestContainerStateMachine {
2724
public TestContainerStateMachineLeader() {
2825
super(true);

0 commit comments

Comments
 (0)