keith-turner commented on code in PR #4295:
URL: https://github.com/apache/accumulo/pull/4295#discussion_r1499952718


##########
test/src/main/java/org/apache/accumulo/test/manager/SuspendedTabletsIT.java:
##########
@@ -300,27 +255,43 @@ private void suspensionTestBody(TServerKiller 
serverStopper) throws Exception {
         assertEquals(beforeDeathState.hosted.get(server), 
deadTabletsByServer.get(server));
       }
       assertEquals(TABLETS, ds.hostedCount + ds.suspendedCount);
-      // Restart the first tablet server, making sure it ends up on the same 
port
-      HostAndPort restartedServer = 
deadTabletsByServer.keySet().iterator().next();
-      log.info("Restarting " + restartedServer);
-      getCluster().getClusterControl().start(ServerType.TABLET_SERVER,
-          Map.of(Property.TSERV_CLIENTPORT.getKey(), "" + 
restartedServer.getPort(),
-              Property.TSERV_PORTSEARCH.getKey(), "false"),
-          1);
-
-      // Eventually, the suspended tablets should be reassigned to the newly 
alive tserver.
-      log.info("Awaiting tablet unsuspension for tablets belonging to " + 
restartedServer);
-      while (ds.suspended.containsKey(restartedServer) || ds.assignedCount != 
0) {
-        Thread.sleep(1000);
-        ds = TabletLocations.retrieve(ctx, tableName);
-      }
-      assertEquals(deadTabletsByServer.get(restartedServer), 
ds.hosted.get(restartedServer));
 
-      // Finally, after much longer, remaining suspended tablets should be 
reassigned.
-      log.info("Awaiting tablet reassignment for remaining tablets");
-      while (ds.hostedCount != TABLETS) {
-        Thread.sleep(1000);
-        ds = TabletLocations.retrieve(ctx, tableName);
+      assertTrue(ds.suspendedCount > 0);
+
+      if (action == AfterSuspendAction.OFFLINE) {
+        client.tableOperations().offline(tableName, true);
+
+        while (ds.suspendedCount > 0) {
+          Thread.sleep(1000);
+          ds = TabletLocations.retrieve(ctx, tableName);
+          log.info("Waiting for suspended {}", ds.suspended);
+        }
+      } else if (action == AfterSuspendAction.RESUME) {

Review Comment:
   The code in this else block was not changed except for indentation and being 
placed in an else block.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to