ibmdb / node-ibm_db

IBM DB2 and IBM Informix bindings for node
MIT License
188 stars 151 forks source link

Bug Report_Getting " PrintDeps.exe Bad image" pop-ups while running tests from terminal using ibm_db package with Playwright with JavaScript #974

Closed 54995610 closed 5 months ago

54995610 commented 6 months ago

System info Playwright Version: v.1.40.1, JavaScript Operating System: Windows 11 Enterprise 64, Version 10.0.19045 Build 19045 Browser: All (for example: Chromium version Node version: v.18.19.0 ibm_db v.3.2.1 (https://www.npmjs.com/package/ibm_db)

We are using Playwright with Javascript for our UI automation where we are also establishing a connection to IBM Database by using following two :-

var ibmdb = require('ibm_db') const open = util.promisify(ibmdb.open)

When I am executing the script I am getting 8 different PrintDeps.exe bad image pop-ops where I have to close all those 8 pop-ups manually and that's when the execution is starting.

We are using version :- "@playwright/test": "^1.40.1".

Note:- I did placed the " var ibmdb = require('ibm_db')" inside the function and I was able to execute the script without any issues. Actual issue comes when I execute my test scripts in Parallel or sequentially, first test script will get executed successfully and as soon second test script starts, we are seeing following 8 pop-ups.

Also, when I comment above two lines of code and assume I am not using ibm_db in my code, all my code is working parallelly and sequentially.

Observation :- When we do npx playwright install on my machine it is downloading "chromium-1091" folder in "C:\Users\Userid\AppData\Local\ms-playwright" folder where I think it is causing the issue.

We did set the PATH and also created a variable 'IBM_DB_HOME' with path having till 'license'.

image

image

image

image

image

image

image

mxschmitt commented 6 months ago

hello from the Playwright team! In the past a few users ran into this issue with using the library, which broke Playwright. We are unsure if its an issue on our or on your side. When I was debugging it, I saw that after we load the native ibm binding, it stops working, maybe you have a clue on whats going on there. See https://github.com/microsoft/playwright/issues/28846#issuecomment-1876068609.

Thanks!

bimalkjha commented 6 months ago

@mxschmitt @54995610 what was the previous version of ibm_db which was working? In the shared code, I see you are promisifying ibmdb.open() as const open = util.promisify(ibmdb.open). It may be the cause of issue as open api returns promise in latest version if you do not pass a callback function. In fact, all ibmdb apis returns promise and you can use it for async-await programming. Please check and update. thanks.

mxschmitt commented 6 months ago

I think it was never working. It only reproduces on Windows and it also reproduced without util.promisify.

54995610 commented 6 months ago

That's correct we are also seeing this issue even without using util,promisify.

bimalkjha commented 5 months ago

@54995610 Could you please share simplified steps to reproduce this issue on my Windows system? I have not used Playwright yet. Thanks.

mxschmitt commented 5 months ago

OS: Windows

npm init playwright my-project
cd my-project
// put the require inside tests/example.spec.ts
npx playwright test

Actual: throws with a weird error (via a Windows MessageBox) when we launch PrintDeps.exe via child_process.spawn Expected: Does not

Note: We mitigated it on the Playwright side for now, @54995610 has not confirmed yet, that it works for him, but for me did not reproduce anymore.

bimalkjha commented 5 months ago

@mxschmitt Thanks for sharing the repro steps. I am able to reproduce the issue and getting test result as below:

C:\nodework\defects\my-proj>npx playwright test

Running 6 tests using 4 workers
  6 passed (37.6s)

To open last HTML report run:

  npx playwright show-report

C:\nodework\defects\my-proj>

The reason for these pop-ups only for require('ibm_db') is unknown for me. We need detailed info from playwright team about this behavior, then we can look further. Thanks.

bimalkjha commented 5 months ago

Closing the issue now as issue seems with playwright. Once, you have input from playwrite team with detail, you can post here and we can reopen the issue. Thanks.