Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Transform] Improve robustness when saving state #62086

Merged
merged 21 commits into from
Sep 28, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
assert that state has been persisted with shouldStopAtCheckpoint
Hendrik Muhs committed Sep 23, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 447504b4bb83048c320a978c6ef8f6cc32892b01
Original file line number Diff line number Diff line change
@@ -481,26 +481,34 @@ public void testStopAtCheckpointForThrottledTransform() throws Exception {

// the calls are likely executed _before_ the next search is even scheduled
assertResponse(listener -> setStopAtCheckpoint(indexer, true, listener));
assertTrue(indexer.getPersistedState().shouldStopAtNextCheckpoint());
assertResponse(listener -> setStopAtCheckpoint(indexer, false, listener));
assertFalse(indexer.getPersistedState().shouldStopAtNextCheckpoint());
assertResponse(listener -> setStopAtCheckpoint(indexer, true, listener));
assertTrue(indexer.getPersistedState().shouldStopAtNextCheckpoint());
assertResponse(listener -> setStopAtCheckpoint(indexer, true, listener));
assertResponse(listener -> setStopAtCheckpoint(indexer, false, listener));
assertFalse(indexer.getPersistedState().shouldStopAtNextCheckpoint());

onResponseLatch.await();
onResponseLatch = indexer.createCountDownOnResponseLatch(1);

// wait until a search is scheduled
assertBusy(() -> assertTrue(indexer.waitingForNextSearch()), 5, TimeUnit.SECONDS);
assertResponse(listener -> setStopAtCheckpoint(indexer, true, listener));
assertTrue(indexer.getPersistedState().shouldStopAtNextCheckpoint());

onResponseLatch.await();
onResponseLatch = indexer.createCountDownOnResponseLatch(1);

assertBusy(() -> assertTrue(indexer.waitingForNextSearch()), 5, TimeUnit.SECONDS);
assertResponse(listener -> setStopAtCheckpoint(indexer, false, listener));
assertFalse(indexer.getPersistedState().shouldStopAtNextCheckpoint());

onResponseLatch.await();
assertBusy(() -> assertTrue(indexer.waitingForNextSearch()), 5, TimeUnit.SECONDS);
assertResponse(listener -> setStopAtCheckpoint(indexer, true, listener));
assertTrue(indexer.getPersistedState().shouldStopAtNextCheckpoint());
assertResponse(listener -> setStopAtCheckpoint(indexer, true, listener));

indexer.stop();