Skip to content

Commit

Permalink
make streamFlushMillis defaults larger
Browse files Browse the repository at this point in the history
  • Loading branch information
mceachen committed Feb 25, 2022
1 parent 92cad2c commit fe5e6fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/BatchCluster.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe("BatchCluster", function () {
maxReasonableProcessFailuresPerMinute: 0, // disable. We're expecting flakiness.

// we shouldn't need these overrides, but there it is.
...(isCI ? { streamFlushMillis: bco.streamFlushMillis * 3 } : {}), // < CI is slow
// ...(isCI ? { streamFlushMillis: bco.streamFlushMillis * 3 } : {}), // < CI is slow
// onIdleIntervalMillis: 1000,
}

Expand Down
6 changes: 3 additions & 3 deletions src/BatchClusterOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { BatchClusterEmitter } from "./BatchClusterEmitter"
import { BatchProcessOptions } from "./BatchProcessOptions"
import { InternalBatchProcessOptions } from "./InternalBatchProcessOptions"
import { logger, Logger } from "./Logger"
import { isLinux } from "./Platform"
import { isMac, isWin } from "./Platform"
import { blank, toS } from "./String"

export const secondMs = 1000
Expand Down Expand Up @@ -120,7 +120,7 @@ export class BatchClusterOptions {
* If you set this value too low, tasks may be erroneously resolved or
* rejected (depending on which stream is handled first).
*
* Defaults to 25ms on Linux and 100ms on macOS and Windows due to slower
* Defaults to 25ms on Linux, 150ms on macOS, and 250ms Windows due to slower
* stream flushing on those platforms.
*
* Your system may support a smaller value: this is a pessimistic default. If
Expand All @@ -130,7 +130,7 @@ export class BatchClusterOptions {
* most likely result in internal errors (due to stream buffers not being able
* to be associated to tasks that were just settled)
*/
streamFlushMillis = isLinux ? 25 : 100
streamFlushMillis = isMac ? 150 : isWin ? 250 : 25

/**
* Should batch-cluster try to clean up after spawned processes that don't
Expand Down

0 comments on commit fe5e6fd

Please sign in to comment.