void () { PlatformTestUtil.startPerformanceTest("single stream", 30000, () -> { mySynchronizer = new MockProcessStreamsSynchronizer(getTestRootDisposable()); long nowTimeMillis = 10; for (int i = 0; i < 10_000_000; i++) { mySynchronizer.doWhenStreamsSynchronized("Std", ProcessOutputType.STDOUT, nowTimeMillis); mySynchronizer.doWhenStreamsSynchronized("Out\n", ProcessOutputType.STDOUT, nowTimeMillis + 5); mySynchronizer.doWhenStreamsSynchronized("#2 Std", ProcessOutputType.STDOUT, nowTimeMillis + 6); mySynchronizer.doWhenStreamsSynchronized("#2 Out\n", ProcessOutputType.STDOUT, nowTimeMillis + 7); mySynchronizer.doWhenStreamsSynchronized("stdout again", ProcessOutputType.STDOUT, nowTimeMillis + 8); mySynchronizer.advanceTimeTo(nowTimeMillis + 8); assertFlushedChunks( new FlushedChunk("Std", ProcessOutputType.STDOUT, nowTimeMillis), new FlushedChunk("Out\n", ProcessOutputType.STDOUT, nowTimeMillis + 5), new FlushedChunk("#2 Std", ProcessOutputType.STDOUT, nowTimeMillis + 6), new FlushedChunk("#2 Out\n", ProcessOutputType.STDOUT, nowTimeMillis + 7), new FlushedChunk("stdout again", ProcessOutputType.STDOUT, nowTimeMillis + 8) ); assertNoPendingChunks(); nowTimeMillis += 8; } }).assertTiming(); }