From eb9b84e6c341be2c99fa2d8adf71cc24b0b82212 Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Mon, 15 Aug 2016 17:27:01 -0400 Subject: [PATCH] Fix broken test Randomized testing requires that we clean all the static state in test classess. --- .../search/internal/ShardSearchTransportRequestTests.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/src/test/java/org/elasticsearch/search/internal/ShardSearchTransportRequestTests.java b/core/src/test/java/org/elasticsearch/search/internal/ShardSearchTransportRequestTests.java index e5ab9ca39ec..a49fdef5596 100644 --- a/core/src/test/java/org/elasticsearch/search/internal/ShardSearchTransportRequestTests.java +++ b/core/src/test/java/org/elasticsearch/search/internal/ShardSearchTransportRequestTests.java @@ -37,6 +37,7 @@ import org.elasticsearch.snapshots.Snapshot; import org.elasticsearch.snapshots.SnapshotId; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.VersionUtils; +import org.junit.AfterClass; import org.junit.BeforeClass; import java.io.IOException; @@ -69,6 +70,11 @@ public class ShardSearchTransportRequestTests extends ESTestCase { namedWriteableRegistry = new NamedWriteableRegistry(entries); } + @AfterClass + public static void afterClass() { + namedWriteableRegistry = null; + } + public void testSerialization() throws Exception { ShardSearchTransportRequest shardSearchTransportRequest = createShardSearchTransportRequest(); try (BytesStreamOutput output = new BytesStreamOutput()) {