devlato / async-wait-until

Waits for an expectation to be truthy. A small library with a convenient API suitable for unit and integration testing
https://devlato.github.io/async-wait-until/
MIT License
75 stars 13 forks source link

[Bug Report] version 2.0.1 breaks builds #9

Closed lhein closed 3 years ago

lhein commented 3 years ago

While version 1.2.6 was working just fine after an upgrade to 2.0.1 the build breaks for no reason. (and on multiple projects which use this dependency)

The following log output is from Circle CI build. I am wondering what the reason could be.

Any idea, Denis?

#!/bin/bash -eo pipefail
npm test

> atlasmap-viewer@0.0.7 test /home/circleci/vscode-atlasmap
> node ./out/test/runTest.js

Downloading VS Code 1.53.2 from https://update.code.visualstudio.com/1.53.2/linux-x64/stableDownloading VS Code 1.53.2 from https://update.code.visualstudio.com/1.53.2/linux-x64/stable: 3784693/95471832 (4%)Downloading VS Code 1.53.2 from https://update.code.visualstudio.com/1.53.2/linux-x64/stable: 7585789/95471832 (8%)Downloading VS Code 1.53.2 from https://update.code.visualstudio.com/1.53.2/linux-x64/stable: 11517949/95471832 (12%)Downloading VS Code 1.53.2 from https://update.code.visualstudio.com/1.53.2/linux-x64/stable: 16039929/95471832 (17%)Downloading VS Code 1.53.2 from https://update.code.visualstudio.com/1.53.2/linux-x64/stable: 19890174/95471832 (21%)Downloading VS Code 1.53.2 from https://update.code.visualstudio.com/1.53.2/linux-x64/stable: 23150583/95471832 (24%)Downloading VS Code 1.53.2 from https://update.code.visualstudio.com/1.53.2/linux-x64/stable: 26263545/95471832 (28%)Downloading VS Code 1.53.2 from https://update.code.visualstudio.com/1.53.2/linux-x64/stable: 30490615/95471832 (32%)Downloading VS Code 1.53.2 from https://update.code.visualstudio.com/1.53.2/linux-x64/stable: 34422775/95471832 (36%)Downloading VS Code 1.53.2 from https://update.code.visualstudio.com/1.53.2/linux-x64/stable: 39239665/95471832 (41%)Downloading VS Code 1.53.2 from https://update.code.visualstudio.com/1.53.2/linux-x64/stable: 41074673/95471832 (43%)Downloading VS Code 1.53.2 from https://update.code.visualstudio.com/1.53.2/linux-x64/stable: 45809664/95471832 (48%)Downloading VS Code 1.53.2 from https://update.code.visualstudio.com/1.53.2/linux-x64/stable: 50839549/95471832 (53%)Downloading VS Code 1.53.2 from https://update.code.visualstudio.com/1.53.2/linux-x64/stable: 55295997/95471832 (58%)Downloading VS Code 1.53.2 from https://update.code.visualstudio.com/1.53.2/linux-x64/stable: 60227584/95471832 (63%)Downloading VS Code 1.53.2 from https://update.code.visualstudio.com/1.53.2/linux-x64/stable: 65323001/95471832 (68%)Downloading VS Code 1.53.2 from https://update.code.visualstudio.com/1.53.2/linux-x64/stable: 70074359/95471832 (73%)Downloading VS Code 1.53.2 from https://update.code.visualstudio.com/1.53.2/linux-x64/stable: 75284473/95471832 (79%)Downloading VS Code 1.53.2 from https://update.code.visualstudio.com/1.53.2/linux-x64/stable: 79937533/95471832 (84%)Downloading VS Code 1.53.2 from https://update.code.visualstudio.com/1.53.2/linux-x64/stable: 85114865/95471832 (89%)Downloading VS Code 1.53.2 from https://update.code.visualstudio.com/1.53.2/linux-x64/stable: 89964537/95471832 (94%)Downloading VS Code 1.53.2 from https://update.code.visualstudio.com/1.53.2/linux-x64/stable: complete
Downloaded VS Code 1.53.2 into .vscode-test/vscode-linux-x64-1.53.2
Fontconfig warning: "/etc/fonts/fonts.conf", line 100: unknown element "blank"

(electron) Sending uncompressed crash reports is deprecated and will be removed in a future version of Electron. Set { compress: true } to opt-in to the new behavior. Crash reports will be uploaded gzipped, which most crash reporting servers support.

Warning: 'sandbox' is not in the list of known options, but still passed to Electron/Chromium.

[main 2021-02-18T07:08:16.466Z] update#setState idle

bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell

(node:317) electron: The default of contextIsolation is deprecated and will be changing from false to true in a future release of Electron.  See https://github.com/electron/electron/issues/23506 for more information

(node:399) Electron: Loading non-context-aware native module in renderer: '/home/circleci/vscode-atlasmap/.vscode-test/vscode-linux-x64-1.53.2/VSCode-linux-x64/resources/app/node_modules.asar.unpacked/vscode-sqlite3/build/Release/sqlite.node'. This is deprecated, see https://github.com/electron/electron/issues/18397.

(node:399) Electron: Loading non-context-aware native module in renderer: '/home/circleci/vscode-atlasmap/.vscode-test/vscode-linux-x64-1.53.2/VSCode-linux-x64/resources/app/node_modules.asar.unpacked/spdlog/build/Release/spdlog.node'. This is deprecated, see https://github.com/electron/electron/issues/18397.

Exit code:   1
Done

Failed to run tests
npm ERR! Test failed.  See above for more details.

Exited with code exit status 1

CircleCI received exit code 1
devlato commented 3 years ago

@lhein the log you attached is insufficient for detecting an issue. I can see only this error in the above log:

bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell

Which may be unrelated and is 100% not related to async-wait-until.

Could you share an example of how you use async-wait-until after upgrading? I think the way the function should be imported is different now. Before, there supposed to be namespace-like import:

import * as waitUntil from 'async-wait-until';

While for v2.*, there's an ES module-like import:

import { waitUntil } from 'async-wait-until';
lhein commented 3 years ago

Hi Denis,

take a look at this PR for instance: https://github.com/redhat-developer/vscode-didact/pull/424/files

The error output is "non-existent" and that makes it really hard to investigate. The interesting part is that this issue occurs in 4 of our projects which use async-wait-until while the others are not affected. That made me believe it has a connection.

lhein commented 3 years ago

An additional thing I observed... When starting the tests from within VSCode using 1.2.6 all works great. When switching to 2.0.1 using the new import statement the test dies right after start with error ReferenceError: window is not defined. Maybe this is useful.

devlato commented 3 years ago

@lhein this is interesting; thanks, will try to figure it out ASAP

devlato commented 3 years ago

@lhein okay, the fix's on the way; 2.0.2 should be published in ~20 minutes

lhein commented 3 years ago

awesome news. thanks for the quick help!

lhein commented 3 years ago

It doesn't seem to help. Just upgraded to 2.0.2 and it still is broiken with the same error message.

https://github.com/redhat-developer/vscode-didact/runs/1935375646?check_suite_focus=true#step:9:41

devlato commented 3 years ago

Interesting

devlato commented 3 years ago

@lhein could you try 2.0.3?

lhein commented 3 years ago

that one does the trick. Thank you Denis!

devlato commented 3 years ago

Closing it 👍