Skip to content

test/report/test-report-fatal-error.js fails because of bogus expectation #28886

Closed

Description

@hashseed
AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:

  assert(cpus.some((c) => {
    console.log(c.speed, cpu.speed)
    return c.model === cpu.model && c.speed === cpu.speed;
  }))

    at /usr/local/google/home/yangguo/node/test/common/report.js:111:5
    at Array.forEach (<anonymous>)
    at _validateContent (/usr/local/google/home/yangguo/node/test/common/report.js:103:15)
    at validateContent (/usr/local/google/home/yangguo/node/test/common/report.js:40:5)
    at Object.validate (/usr/local/google/home/yangguo/node/test/common/report.js:27:3)
    at ChildProcess.<anonymous> (/usr/local/google/home/yangguo/node/test/report/test-report-fatal-error.js:36:12)
    at ChildProcess.<anonymous> (/usr/local/google/home/yangguo/node/test/common/index.js:371:15)
    at ChildProcess.emit (events.js:203:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)

The reason is simple: when the CPU governor is enabled, the clock speed is variable. The expected speed comes from require('os').cpus(), which may have a different speed than when the report was collected.

Activity

  1. self-assigned this
    on Jul 29, 2019
  2. added
    report
    test
    on Jul 29, 2019
  3. lpinca commented on Jul 29, 2019

    @lpinca
    Member

    Fixed by #28884, reopen if I am wrong.

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

Metadata

Metadata

Assignees

Labels

reporttest

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions