umamaheswararao commented on code in PR #3550:
URL: https://github.com/apache/ozone/pull/3550#discussion_r907467318
##########
hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/ec/reconstruction/TestECReconstructionSupervisor.java:
##########
@@ -17,37 +17,57 @@
*/
package org.apache.hadoop.ozone.container.ec.reconstruction;
+import com.google.common.collect.ImmutableList;
+import org.apache.hadoop.hdds.client.ECReplicationConfig;
+import org.apache.hadoop.hdds.conf.OzoneConfiguration;
+import org.apache.hadoop.hdds.protocol.DatanodeDetails;
import org.apache.ozone.test.GenericTestUtils;
+import org.junit.Assert;
import org.junit.Test;
+import java.io.IOException;
+import java.util.SortedMap;
import java.util.concurrent.TimeoutException;
/**
* Tests the ECReconstructionSupervisor.
*/
public class TestECReconstructionSupervisor {
- private final ECReconstructionSupervisor supervisor =
- new ECReconstructionSupervisor(null, null, 5, null);
-
@Test
public void testAddTaskShouldExecuteTheGivenTask()
- throws InterruptedException, TimeoutException {
- FakeTask task = new FakeTask(null);
- supervisor.addTask(task);
- GenericTestUtils.waitFor(() -> task.isExecuted, 100, 15000);
- }
-
- static class FakeTask extends ECReconstructionCoordinatorTask {
- private boolean isExecuted = false;
-
- FakeTask(ECReconstructionCommandInfo reconstructionCommandInfo) {
- super(null, reconstructionCommandInfo);
- }
-
- @Override
- public void run() {
- isExecuted = true;
- }
+ throws InterruptedException, TimeoutException, IOException {
+ final boolean[] reconstructInvoked = {false};
Review Comment:
Ah it was just intelliJ sggestion :-)
Thanks for suggesting CountDownLatch, it's a good fit here.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]