fredia commented on code in PR #24633:
URL: https://github.com/apache/flink/pull/24633#discussion_r1562344262
##########
flink-runtime/src/test/java/org/apache/flink/runtime/asyncprocessing/AsyncExecutionControllerTest.java:
##########
@@ -152,66 +148,168 @@ void testBasicRun() {
// Single-step run for another key.
// Firstly, the user code generates value get in active buffer.
- assertThat(aec.activeBuffer.size()).isEqualTo(1);
+ assertThat(aec.stateRequestsBuffer.activeQueueSize()).isEqualTo(1);
assertThat(aec.keyAccountingUnit.occupiedCount()).isEqualTo(1);
+ assertThat(aec.inFlightRecordNum.get()).isEqualTo(1);
aec.triggerIfNeeded(true);
// After running, the value update is in active buffer.
- assertThat(aec.activeBuffer.size()).isEqualTo(1);
+ assertThat(aec.stateRequestsBuffer.activeQueueSize()).isEqualTo(1);
assertThat(aec.keyAccountingUnit.occupiedCount()).isEqualTo(1);
+ assertThat(aec.inFlightRecordNum.get()).isEqualTo(1);
aec.triggerIfNeeded(true);
// Value update finishes.
- assertThat(aec.activeBuffer.size()).isEqualTo(0);
+ assertThat(aec.stateRequestsBuffer.activeQueueSize()).isEqualTo(0);
assertThat(aec.keyAccountingUnit.occupiedCount()).isEqualTo(0);
+ assertThat(aec.inFlightRecordNum.get()).isEqualTo(0);
assertThat(output.get()).isEqualTo(1);
assertThat(recordContext4.getReferenceCount()).isEqualTo(0);
}
- /**
- * An AsyncExecutionController for testing purpose, which integrates with
basic buffer
- * mechanism.
- */
- static class TestAsyncExecutionController<R, K> extends
AsyncExecutionController<R, K> {
+ @Test
+ void testRecordsRunInOrder() {
+ AsyncExecutionController<String, String> aec =
+ new AsyncExecutionController<>(new SyncMailboxExecutor(), new
TestStateExecutor());
+ TestUnderlyingState underlyingState = new TestUnderlyingState();
+ TestValueState valueState = new TestValueState(aec, underlyingState);
+ AtomicInteger output = new AtomicInteger();
+ Runnable userCode =
Review Comment:
👍I extracted those codes into a `@BeforeEach` function.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]