Skip to content

benchmark/fs/write-stream-throughput.js can call bench.end() without calling bench.start() #17901

Description

@Trott
  • Version: 10.0.0-pre
  • Platform: n/a
  • Subsystem: benchmark, fs

In benchmark/fs/write-stream-throughput.js, it is possible (if dur is very short) that bench.end() gets called before bench.start(), and that will throw an error. Example at https://ci.nodejs.org/job/node-test-commit-aix/11455/nodes=aix61-ppc64/consoleText:

fs/write-stream-throughput.js
    /home/iojs/build/workspace/node-test-commit-aix/nodes/aix61-ppc64/benchmark/common.js:192
        throw new Error('called end without start');
        ^
    
    Error: called end without start
        at Benchmark.end (/home/iojs/build/workspace/node-test-commit-aix/nodes/aix61-ppc64/benchmark/common.js:192:11)
        at WriteStream.<anonymous> (/home/iojs/build/workspace/node-test-commit-aix/nodes/aix61-ppc64/benchmark/fs/write-stream-throughput.js:57:11)
        at WriteStream.emit (events.js:136:15)
        at finishMaybe (_stream_writable.js:633:14)
        at endWritable (_stream_writable.js:641:3)
        at WriteStream.Writable.end (_stream_writable.js:583:5)
        at Timeout._onTimeout (/home/iojs/build/workspace/node-test-commit-aix/nodes/aix61-ppc64/benchmark/fs/write-stream-throughput.js:46:7)
        at ontimeout (timers.js:454:11)
        at tryOnTimeout (timers.js:304:5)
        at Timer.listOnTimeout (timers.js:264:5)
    assert.js:43
      throw new errors.AssertionError(obj);
      ^

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    benchmarkIssues and PRs related to Node.js benchmarks and benchmarking infrastructure.fsIssues and PRs related to file-system APIs and the fs module.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions