From 56d3a5e6d80318d7d687c1f722007e2f88242d79 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Mon, 26 Jun 2017 14:17:33 -0400 Subject: [PATCH] Fix primary context sealing test This commit updates some assertions in the primary context sealing test after the restriction on updating allocation IDs from master and updating global checkpoint on replica while sealed were removed. --- .../index/seqno/GlobalCheckpointTrackerTests.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/test/java/org/elasticsearch/index/seqno/GlobalCheckpointTrackerTests.java b/core/src/test/java/org/elasticsearch/index/seqno/GlobalCheckpointTrackerTests.java index ae4aab107f2..0eee4eb8a44 100644 --- a/core/src/test/java/org/elasticsearch/index/seqno/GlobalCheckpointTrackerTests.java +++ b/core/src/test/java/org/elasticsearch/index/seqno/GlobalCheckpointTrackerTests.java @@ -693,11 +693,11 @@ public class GlobalCheckpointTrackerTests extends ESTestCase { tracker.primaryContext(); assertTrue(tracker.sealed()); - // invoking any method that mutates the state of the tracker should fail + /* + * Invoking methods that mutates the state of the tracker should fail (with the exception of updating allocation IDs and updating + * global checkpoint on replica which can happen on the relocation source). + */ assertIllegalStateExceptionWhenSealed(() -> tracker.updateLocalCheckpoint(randomAlphaOfLength(16), randomNonNegativeLong())); - assertIllegalStateExceptionWhenSealed(() -> tracker.updateGlobalCheckpointOnReplica(randomNonNegativeLong())); - assertIllegalStateExceptionWhenSealed( - () -> tracker.updateAllocationIdsFromMaster(randomNonNegativeLong(), Collections.emptySet(), Collections.emptySet())); assertIllegalStateExceptionWhenSealed(() -> tracker.updateAllocationIdsFromPrimaryContext(mock(PrimaryContext.class))); assertIllegalStateExceptionWhenSealed(() -> tracker.primaryContext()); assertIllegalStateExceptionWhenSealed(() -> tracker.markAllocationIdAsInSync(randomAlphaOfLength(16), randomNonNegativeLong()));