tillrohrmann commented on a change in pull request #7320: [FLINK-11171] Avoid concurrent usage of StateSnapshotTransformer URL: https://github.com/apache/flink/pull/7320#discussion_r247969937
########## File path: flink-runtime/src/test/java/org/apache/flink/runtime/state/StateBackendTestBase.java ########## @@ -3902,6 +3906,84 @@ public void testParallelAsyncSnapshots() throws Exception { } } + @Test + public void testNonConcurrentSnapshotTransformerAccess() throws Exception { + Random rnd = new Random(); + BlockerCheckpointStreamFactory streamFactory = new BlockerCheckpointStreamFactory(1024 * 1024); + AbstractKeyedStateBackend<Integer> backend = null; + try { + backend = createKeyedBackend(IntSerializer.INSTANCE); + InternalValueState<Integer, VoidNamespace, String> valueState = backend.createInternalState( + VoidNamespaceSerializer.INSTANCE, + new ValueStateDescriptor<>("test", StringSerializer.INSTANCE), + createSingleThreadAccessCheckingStateSnapshotTransformFactory()); + + valueState.setCurrentNamespace(VoidNamespace.INSTANCE); + + for (int i = 0; i < 100; i++) { + backend.setCurrentKey(i); + valueState.update(StringUtils.getRandomString(rnd,5, 10)); Review comment: whitespace missing ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services