@Test public void testSubmissionTimeoutCancelsInFlightTasks() throws InterruptedException {

  assumeFalse(threading == Threading.DIRECT);
  assumeTrue(mode == Mode.INTERRUPTIBLY);
  maxInFlight = 2;
  timeout = Duration.ofMillis(1);
  assertThrows(
      TimeoutException.class,
      () -> parallelize(serialTasks(
          () -> blockFor(1), // Will be interrupted
          () -> blockFor(2), // Will be interrupted
          () -> translateToString(3))));  // Times out
  shutdownAndAssertInterruptedKeys().containsExactly(1, 2);
  assertThat(translated).doesNotContainKey(3);
}