From af4a0495e755c5e417ec702c8ff23164bc6fd0ed Mon Sep 17 00:00:00 2001 From: Duo Zhang Date: Thu, 11 Apr 2019 16:09:49 +0800 Subject: [PATCH] HBASE-22207 Fix flakey TestAssignmentManager.testAssignSocketTimeout --- .../hadoop/hbase/master/assignment/TestAssignmentManager.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestAssignmentManager.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestAssignmentManager.java index 6a0807002926..30a57320ae3c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestAssignmentManager.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestAssignmentManager.java @@ -92,7 +92,9 @@ public void testAssignSocketTimeout() throws Exception { rsDispatcher.setMockRsExecutor(new SocketTimeoutRsExecutor(20)); waitOnFuture(submitProcedure(createAssignProcedure(hri))); - assertEquals(assignSubmittedCount + 1, assignProcMetrics.getSubmittedCounter().getCount()); + // we crashed a rs, so it is possible that there are other regions on the rs which will also be + // reassigned, so here we just assert greater than, not the exact number. + assertTrue(assignProcMetrics.getSubmittedCounter().getCount() > assignSubmittedCount); assertEquals(assignFailedCount, assignProcMetrics.getFailedCounter().getCount()); }