curcur commented on a change in pull request #17462:
URL: https://github.com/apache/flink/pull/17462#discussion_r749082756
##########
File path:
flink-state-backends/flink-statebackend-changelog/src/test/java/org/apache/flink/state/changelog/ChangelogStateBackendTestUtils.java
##########
@@ -158,16 +155,15 @@ public static void testMaterializedRestore(
keyedBackend.setCurrentKey(2);
state.update(new StateBackendTestBase.TestPojo("u2", 2));
- awaitMaterialization(keyedBackend, env.getMainMailboxExecutor());
+ // trigger materialization manually
+ periodicMaterializationManager.triggerMaterialization();
keyedBackend.setCurrentKey(2);
state.update(new StateBackendTestBase.TestPojo("u2", 22));
keyedBackend.setCurrentKey(3);
state.update(new StateBackendTestBase.TestPojo("u3", 3));
- awaitMaterialization(keyedBackend, env.getMainMailboxExecutor());
-
Review comment:
Why is the test single thread? Because the materialization is triggered
manually from the main thread now, the mailbox executor is sycn mailbox and
async pool is a direct executor. Now everything is executed in a single thread.
This is easier to reason about for a unit test. I am writing a ITTest as well.
So multi-thread will be tested in a separate ticket.
##########
File path:
flink-state-backends/flink-statebackend-changelog/src/test/java/org/apache/flink/state/changelog/ChangelogStateBackendTestUtils.java
##########
@@ -158,16 +155,15 @@ public static void testMaterializedRestore(
keyedBackend.setCurrentKey(2);
state.update(new StateBackendTestBase.TestPojo("u2", 2));
- awaitMaterialization(keyedBackend, env.getMainMailboxExecutor());
+ // trigger materialization manually
+ periodicMaterializationManager.triggerMaterialization();
keyedBackend.setCurrentKey(2);
state.update(new StateBackendTestBase.TestPojo("u2", 22));
keyedBackend.setCurrentKey(3);
state.update(new StateBackendTestBase.TestPojo("u3", 3));
- awaitMaterialization(keyedBackend, env.getMainMailboxExecutor());
-
Review comment:
Why is the test single thread? Because the materialization is triggered
manually from the main thread now, the mailbox executor is sycn mailbox and
async pool is a direct executor. Now everything is executed in a single thread.
This is easier to reason about for a unit test.
--
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]