privacytests / privacytests.org

Source code for privacytests.org. Includes browser testing code and site rendering.
https://privacytests.org
MIT License
797 stars 23 forks source link

node test fails with TypeError [ERR_INVALID_ARG_TYPE] The "src" argument must be #154

Closed djalan closed 1 year ago

djalan commented 1 year ago

node test config/desktop.yaml not working

dnf install libpng-devel libxtst-devel libx11-devel completed under fedora 37

node -v is v18.12.1

[alain@fedora-black scripts]$ node test config/desktop.yaml 
2023-02-24T10:05:14.596Z TypeError [ERR_INVALID_ARG_TYPE]: The "src" argument must be of type string or an instance of Buffer or URL. Received an instance of Array
    at Object.copyFileSync (node:fs:2857:9)
    at installTestFontIfNeeded (/home/alain/repositories_git/privacytests.org/scripts/test.js:82:8)
    at main (/home/alain/repositories_git/privacytests.org/scripts/test.js:542:5)
    at Object.<anonymous> (/home/alain/repositories_git/privacytests.org/scripts/test.js:571:3)
    at Module._compile (node:internal/modules/cjs/loader:1159:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
    at Module.load (node:internal/modules/cjs/loader:1037:32)
    at Module._load (node:internal/modules/cjs/loader:878:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:23:47 {
  code: 'ERR_INVALID_ARG_TYPE'
}
2023-02-24T10:05:14.620Z exit 0
2023-02-24T10:05:14.620Z cleaning up
djalan commented 1 year ago

I saw in another issue that your source code is working with node 17. What exact version of node 17 are you using? I tried 17.9.1 but I still had a error. Thanks.

arthuredelstein commented 1 year ago

Hi @djalan -- thanks for reporting this bug. Sorry for the delay -- the bug has now been fixed in 4e954560747924f79e69adb2a2951d9a6be3df31.

I also checked the latest version of node (19.7.0) and it ran correctly. Please let me know if you run into any more issues.

djalan commented 1 year ago

@arthuredelstein What version of Ubuntu or Debian are you running? It only worked once/partially out of 15 tries under my Fedora. It always hangs at the very first test.

It is closing Firefox, then re-opening it, and it's telling me that a Firefox process is already running. I tried various combinations of waiting and handling pop-ups myself. It worked partially after I edited about:confg manually trying some stuff like disabling session restore.

djalan commented 1 year ago

I can now get the script to complete in a VM with Ubuntu 22.04. I will open a PR for a missing dependency and a new config file for a puppeteer warning.

On the other hand, is it normal that I get a process kill error ESRCH over and over again while running tests for Firefox? Are you not catching this error on purpose by any chance?

@arthuredelstein thanks