Github user StefanRRichter commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5239#discussion_r168499252
  
    --- Diff: 
flink-runtime/src/test/java/org/apache/flink/runtime/state/TaskExecutorLocalStateStoresManagerTest.java
 ---
    @@ -100,21 +109,27 @@ public void testSubtaskStateStoreDirectoryCreation() 
throws Exception {
                int subtaskIdx = 42;
                TemporaryFolder tmp = new TemporaryFolder();
                try {
    +
                        tmp.create();
    -                   File localStoreDir = tmp.newFolder();
    +                   File[] rootDirs = {tmp.newFolder(), tmp.newFolder(), 
tmp.newFolder()};
                        TaskExecutorLocalStateStoresManager storesManager =
    -                           new 
TaskExecutorLocalStateStoresManager(localStoreDir);
    +                           new 
TaskExecutorLocalStateStoresManager(rootDirs);
     
                        TaskLocalStateStore taskLocalStateStore =
                                storesManager.localStateStoreForTask(jobID, 
jobVertexID, subtaskIdx);
     
    -                   Assert.assertEquals(
    -                           new File(localStoreDir, 
TaskLocalStateStore.createSubtaskPath(jobID, jobVertexID, subtaskIdx)),
    -                           
taskLocalStateStore.getSubtaskLocalStateBaseDirectory());
    +                   LocalRecoveryDirectoryProvider directoryProvider =
    +                           
taskLocalStateStore.createLocalRecoveryRootDirectoryProvider();
    +
    +                   for (int i = 0; i < 10; ++i) {
    +                           Assert.assertEquals(
    +                                   rootDirs[(i & Integer.MAX_VALUE) % 
rootDirs.length],
    +                                   directoryProvider.nextRootDirectory());
    +                   }
    --- End diff --
    
    It has a dedicated test, maybe also from a later commit.


---

Reply via email to