kintone/js-sdk

`yarn test` sometimes fails due to timeout

zaki-yama opened this issue · 1 comments

Target Package

  • @kintone/data-loader

Environment

  • Operating System: macOS 10.15.7
  • Browser: N.A.
  • Node.js version: v14.16.1

Current Behavior

It depends on the spec of PC, but I sometimes face this error when running yarn test at the root of js-sdk.

$ yarn test

...

FAIL src/__tests__/main.test.ts (39.343 s)
  ● main › should throw error when no commands are passed

    thrown: "Exceeded timeout of 5000 ms for a test.
    Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."

      28 |
      29 | describe("main", () => {
    > 30 |   it("should throw error when no commands are passed", () => {
         |   ^
      31 |     return checkRejectArg({
      32 |       arg: "",
      33 |       errorMessage: "Not enough non-option arguments: got 0, need at least 1",

      at __tests__/main.test.ts:30:3
      at Object.<anonymous> (__tests__/main.test.ts:29:1)

Test Suites: 1 failed, 14 passed, 15 total
Tests:       1 failed, 36 passed, 37 total
Snapshots:   0 total
Time:        40.404 s
Ran all test suites.
error Command failed with exit code 1.
lerna ERR! yarn run test exited 1 in '@kintone/data-loader'
lerna WARN complete Waiting for 2 child processes to exit. CTRL-C to exit immediately.

We set jest.setTimeout in #882 , but it doesn't seem to work?
(The error message says "Exceeded timeout of 5000 ms")

Expected Behavior

jest.setTimeout works correctly, and the tests pass.

Related jest issues:

According to the first issue,

As a side note, after adding a global timeout in the jest config the problems went away,