@Test
  public void interleavedOperationsTest() throws Exception {
    List<OperationChain> opChains = new ArrayList<>();
    Random random = new Random();
    for (int i = 0; i < 10; i++) {
      Queue<OperationType> operations = new LinkedList<>();
      switch (i % 3) {
        case 0:
          operations.add(OperationType.PUT);
          operations.add(OperationType.AWAIT_CREATION);
          operations.add(OperationType.GET_AUTHORIZATION_FAILURE);
          operations.add(OperationType.GET);
          operations.add(OperationType.GET_INFO);
          operations.add(OperationType.TTL_UPDATE);
          operations.add(OperationType.AWAIT_TTL_UPDATE);
          operations.add(OperationType.GET);
          operations.add(OperationType.GET_INFO);
          operations.add(OperationType.DELETE);
          operations.add(OperationType.AWAIT_DELETION);
          operations.add(OperationType.GET_DELETED);
          operations.add(OperationType.GET_INFO_DELETED);
          operations.add(OperationType.GET_DELETED_SUCCESS);
          operations.add(OperationType.GET_INFO_DELETED_SUCCESS);
          break;
        case 1:
          operations.add(OperationType.PUT);
          operations.add(OperationType.AWAIT_CREATION);
          operations.add(OperationType.DELETE_AUTHORIZATION_FAILURE);
          operations.add(OperationType.DELETE);
          operations.add(OperationType.AWAIT_DELETION);
          operations.add(OperationType.GET_DELETED);
          operations.add(OperationType.GET_INFO_DELETED);
          operations.add(OperationType.GET_DELETED);
          operations.add(OperationType.GET_INFO_DELETED);
          operations.add(OperationType.GET_DELETED_SUCCESS);
          operations.add(OperationType.GET_INFO_DELETED_SUCCESS);
          break;
        case 2:
          operations.add(OperationType.PUT);
          operations.add(OperationType.AWAIT_CREATION);
          operations.add(OperationType.GET);
          operations.add(OperationType.GET);
          operations.add(OperationType.GET_AUTHORIZATION_FAILURE);
          operations.add(OperationType.GET);
          operations.add(OperationType.GET_INFO);
          operations.add(OperationType.TTL_UPDATE);
          operations.add(OperationType.AWAIT_TTL_UPDATE);
          operations.add(OperationType.GET);
          operations.add(OperationType.GET_INFO);
          break;
      }
      int blobSize = random.nextInt(1024);
      opChains.add(testFramework.startOperationChain(blobSize, null, i, operations));
    }
    testFramework.checkOperationChains(opChains);
  }
Test that the non blocking router can handle a large number of concurrent (small blob) operations without errors.
This test creates chains of operations without waiting for previous operations to finish.
@throws Exception
ambry-server/src/integration-test/java/com/github/ambry/server/RouterServerHttp2Test.java