Skip to content

Commit

Permalink
[FLINK-11280] [state backends, tests] Do not set current key before r…
Browse files Browse the repository at this point in the history
…estore in TtlStateTestBase tests
  • Loading branch information
tzulitai committed Jan 8, 2019
1 parent f39fd29 commit 31685a3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,8 @@ void createAndRestoreKeyedStateBackend() {
keyedStateBackend = stateBackend.createKeyedStateBackend(
env, new JobID(), "test", StringSerializer.INSTANCE, 10,
new KeyGroupRange(0, 9), env.getTaskKvStateRegistry(), timeProvider);
keyedStateBackend.setCurrentKey("defaultKey");
} catch (Exception e) {
throw new RuntimeException("unexpected");
throw new RuntimeException("unexpected", e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ private void initTest(StateTtlConfig ttlConfig) throws Exception {
this.ttlConfig = ttlConfig;
sbetc.createAndRestoreKeyedStateBackend();
sbetc.restoreSnapshot(null);
sbetc.setCurrentKey("defaultKey");
createState();
ctx().initTestValues();
}
Expand All @@ -129,6 +130,7 @@ private void takeAndRestoreSnapshot() throws Exception {
KeyedStateHandle snapshot = sbetc.takeSnapshot();
sbetc.createAndRestoreKeyedStateBackend();
sbetc.restoreSnapshot(snapshot);
sbetc.setCurrentKey("defaultKey");
createState();
}

Expand Down Expand Up @@ -397,6 +399,7 @@ public void testRestoreTtlAndRegisterNonTtlStateCompatFailure() throws Exception
sbetc.createAndRestoreKeyedStateBackend();

sbetc.restoreSnapshot(snapshot);
sbetc.setCurrentKey("defaultKey");
sbetc.createState(ctx().createStateDescriptor(), "");
}

Expand Down

0 comments on commit 31685a3

Please sign in to comment.