From 4f262ce11e88329d88ea816a18387c980cd9432b Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Mon, 15 Aug 2016 18:51:17 -0400 Subject: [PATCH] Clear some more static state in tests This was causing CI build failures that didn't reproduce consistently locally. Hopefully this will fix the error on CI. --- .../java/org/elasticsearch/search/SearchRequestTests.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/src/test/java/org/elasticsearch/search/SearchRequestTests.java b/core/src/test/java/org/elasticsearch/search/SearchRequestTests.java index 5861dd5eb13..3db3492f415 100644 --- a/core/src/test/java/org/elasticsearch/search/SearchRequestTests.java +++ b/core/src/test/java/org/elasticsearch/search/SearchRequestTests.java @@ -30,6 +30,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.indices.IndicesModule; import org.elasticsearch.test.ESTestCase; +import org.junit.AfterClass; import org.junit.BeforeClass; import java.io.IOException; @@ -64,6 +65,11 @@ public class SearchRequestTests extends ESTestCase { namedWriteableRegistry = new NamedWriteableRegistry(entries); } + @AfterClass + public static void afterClass() { + namedWriteableRegistry = null; + } + public void testSerialization() throws Exception { SearchRequest searchRequest = createSearchRequest(); try (BytesStreamOutput output = new BytesStreamOutput()) {