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()) {