From ef04f0e6ce018ca03186157ecdf5d70d50f708d5 Mon Sep 17 00:00:00 2001 From: Dave Borowitz Date: Fri, 24 May 2019 10:42:22 -0700 Subject: [PATCH] Error Prone: Enable and fix FutureReturnValueIgnored Change-Id: I7d119d05fdcea1ce13aca4a4f8ec9e172e5b98a3 --- .../ElasticV7QueryChangesTest.java | 20 +++++++++++-------- tools/BUILD | 2 +- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/javatests/com/google/gerrit/elasticsearch/ElasticV7QueryChangesTest.java b/javatests/com/google/gerrit/elasticsearch/ElasticV7QueryChangesTest.java index ba4d6fc083..ae00e0d0de 100644 --- a/javatests/com/google/gerrit/elasticsearch/ElasticV7QueryChangesTest.java +++ b/javatests/com/google/gerrit/elasticsearch/ElasticV7QueryChangesTest.java @@ -14,6 +14,8 @@ package com.google.gerrit.elasticsearch; +import static java.util.concurrent.TimeUnit.MINUTES; + import com.google.gerrit.elasticsearch.ElasticTestUtils.ElasticNodeInfo; import com.google.gerrit.server.query.change.AbstractQueryChangesTest; import com.google.gerrit.testing.ConfigSuite; @@ -65,14 +67,16 @@ public class ElasticV7QueryChangesTest extends AbstractQueryChangesTest { @Rule public final GerritTestName testName = new GerritTestName(); @After - public void closeIndex() { - client.execute( - new HttpPost( - String.format( - "http://localhost:%d/%s*/_close", - nodeInfo.port, testName.getSanitizedMethodName())), - HttpClientContext.create(), - null); + public void closeIndex() throws Exception { + client + .execute( + new HttpPost( + String.format( + "http://localhost:%d/%s*/_close", + nodeInfo.port, testName.getSanitizedMethodName())), + HttpClientContext.create(), + null) + .get(5, MINUTES); } @Override diff --git a/tools/BUILD b/tools/BUILD index 18a9d03be4..c5a54d1c56 100644 --- a/tools/BUILD +++ b/tools/BUILD @@ -59,7 +59,7 @@ java_package_configuration( "-Xep:FragmentInjection:ERROR", "-Xep:FragmentNotInstantiable:ERROR", "-Xep:FunctionalInterfaceClash:ERROR", - #"-Xep:FutureReturnValueIgnored:ERROR", + "-Xep:FutureReturnValueIgnored:ERROR", #"-Xep:GetClassOnEnum:ERROR", "-Xep:ImmutableAnnotationChecker:ERROR", #"-Xep:ImmutableEnumChecker:ERROR",