@Test
  public void testBasicThreadSubmission() throws InterruptedException {
    // Setup test environment
    List<String> mountPaths = new ArrayList<>();
    mountPaths.add("/tmp/1");
    mountPaths.add("/tmp/2");
    Port port = new Port(1, PortType.PLAINTEXT);
    MockDataNodeId dataNodeId = new MockDataNodeId("peerNode", Collections.singletonList(port), mountPaths, "peerDatacenter");

    // Create thread pool manager with 2 threads per disk
    DiskAwareFileCopyThreadPoolManager threadPoolManager = new DiskAwareFileCopyThreadPoolManager(dataNodeId.getDiskIds(), 2);
    Thread threadPoolManagerThread = new Thread(threadPoolManager);
    threadPoolManagerThread.start();

    // Create test tracking map
    final Map<String, Integer> successFailCount = new HashMap<>();
    successFailCount.put("success", 0);
    successFailCount.put("fail", 0);

    // Submit threads for each disk
    for (DiskId diskId : dataNodeId.getDiskIds()) {
      PartitionId partitionId = new MockPartitionId(100, MockClusterMap.DEFAULT_PARTITION_CLASS,
          Collections.singletonList(dataNodeId), 0);
      ReplicaId replicaId = partitionId.getReplicaIds().get(0);

      // Submit max threads per disk
      for (int i = 0; i < 2; i++) {
        FileCopyStatusListener listener = new FileCopyStatusListener() {
          @Override
          public void onFileCopySuccess() {
            successFailCount.put("success", successFailCount.get("success") + 1);
          }

          @Override
          public ReplicaId getReplicaId() {
            return replicaId;
          }

          @Override
          public void onFileCopyFailure(Exception e) {
            successFailCount.put("fail", successFailCount.get("fail") + 1);
          }
        };


        Thread.sleep(3000);
        FileCopyHandler handler = new MockFileCopyHandlerFactory().getFileCopyHandler();
        threadPoolManager.submitReplicaForHydration(replicaId, listener, handler);
      }
    }

    // Cleanup
    threadPoolManager.shutdown();
    threadPoolManagerThread.join();
    assertEquals("All copy operations should succeed", 4, successFailCount.get("success").intValue());
    assertEquals("No operations should fail", 0, successFailCount.get("fail").intValue());
  }
Tests basic thread submission and scheduling
ambry-file-transfer/src/test/java/com/github/ambry/filetransfer/DiskAwareFileCopyThreadPoolManagerTest.java