ripe-tech/ripe-sdk

Tests are consistently failing and deployment is failing

Closed this issue · 2 comments

Description

The npm run test step of the deployment is consistently failing in the same step and is not related to the deployment.

The error log is the following:

  1) ConfigAPI
       #configResolveSku()
         should resolve SKU:
     Uncaught TypeError: Cannot read property 'body' of null
      at /__w/ripe-sdk/ripe-sdk/node_modules/node-fetch/lib/index.js:1519:27
      at IncomingMessage.<anonymous> (node_modules/node-fetch/lib/index.js:1749:6)
      at IncomingMessage.<anonymous> (_http_client.js:389:14)
      at endReadableNT (_stream_readable.js:1241:12)
      at processTicksAndRejections (internal/process/task_queues.js:84:21)

  2) ConfigAPI
       #configResolveSku()
         should resolve SKU:
     Error: done() called multiple times in test <ConfigAPI #configResolveSku() should resolve SKU> of file /__w/ripe-sdk/ripe-sdk/test/js/api/config.js
      at runMicrotasks (<anonymous>)
      at processTicksAndRejections (internal/process/task_queues.js:97:5)



[12:00:20] 'test' errored after 2.78 min
[12:00:20] Error in plugin "gulp-mocha"

After an in-depth inspection the error is caused because of the race condition to delete the SKU at https://github.com/ripe-tech/ripe-sdk/blob/master/test/js/api/config.js#L199

This implementation of Promise will run after the test block is complete and call done a little bit after the previous requests are also complete which means done() will be called 2 times and thus the error "done() called multiple times".

This is not reproducible locally which means that is impacted by the network and processing speed - because the workflows are run on a low tier container it always reproduces.

Expected vs. Observed

- -
Expected The tests pass.
Observed The tests fail.

Repro Steps

  1. Run yarn && yarn build && yarn test
  2. See tests failing

Woof, Woof!

Thank you @3rdvision for submitting the "Tests are consistently failing and deployment is failing" issue 😎.

Please do not forget to review our internal guidelines:

  • Describe the problem in the best possible way
  • Include at least the Description section, but considered adding other sections
  • Avoid suggesting immediate solutions, think deeply about the problem
  • Engage in the Triage process being as responsive as possible
  • Understand and accept the possibly large amount of execution time
  • Avoid immediate reallocation of the issue, let triage do their job

Engaging in the development process in the best possible way helps it being efficient and fast.

Your friend,
Tobias (Platforme's mascot)

Tobias Bot

Closing this as this specific error is no longer occurring.