-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] Could pirates hook be extended to provide more info on failure? #17657
Comments
also we are using typescript, esm and type is set to module |
@Smrtnyk One reason why it might reproduce on CI and not locally is due to the cache playwright uses for local runs. Could you try repro'ing locally clearing the cache every time? Like this: rm -rf ./pwcache && PWTEST_CACHE_DIR=./pwcache npx playwright test Without a repro we're not sure what to change where to make your debugging easier. |
I have tried running it your suggestions, tried executing many times but with no luck getting the issue. |
I guess pirates is still needed if esm has some interop with cjs |
@Smrtnyk Since we're talking at this technical level... Any chance you can do a fork of Playwright with the changes you suggest and show us the CI output without and with your changes? |
Sure, sounds reasonable. Will try it on monday |
Actually I had some spare time. I have forked and pushed changes to my fork. |
Once you have a checkout: $ npm i # install all deps
$ npm run build # build everything
$ ./utils/pack_package.js playwright-core ./pwc.tar.gz # package playwright-core
$ ./utils/pack_package.js playwright-test ./pwt.tar.gz # package playwright-test Note that you need both Now you can use $ cd <your package>
$ npm i <path-to-pwc.tar.gz> # install your build of playwright-core
$ npm i <path-to-pwt.tar.gz> # install your build of playwright-test |
Tnx, I was able to exercise CI with my changes to the playwright [2022-10-01T16:28:45.287Z] TypeError: Cannot read properties of undefined (reading 'isNative') I suspect this one is coming from source-map-support. Any other ideas of what I could try? |
I have a scenario in CI where it never happened and I executed around 100s of builds If I only run one stage with 1 shard, in this case I took chromium, I wasn't able to reproduce it. |
@aslushnikov I think I was deceived here by the contents of the files in CI that was in output Error.prepareStackTrace = (error, stackFrames) => {
const frame: NodeJS.CallSite = sourceMapSupport.wrapCallSite(stackFrames[1]); seems like stackFrames[1] is undefined |
@Smrtnyk any chance you can share a repro where |
Locally I maybe saw it once, so I have no idea how to build something that can reliably cause that. |
We would need exact steps to follow in order to address this. As long as we can't repro it, it is unlikely with can make progress with it. Allow me to close it, but please file a new one and link to this issue if you manage to reproduce it. |
Well I have pointed to a place where code is unguarded. I don't know how to reproduce it because I have no idea what happens to come to that. |
Alright, it is actually possible for that array to be empty
you provoke that behavior. |
There are definitely cases in general where stack may be an empty array, but |
We don't override captureStackTrace in our code, but it might be hidden somewhere in some package that we use |
Given the log I provided above and value of this message, seems like it recursed few times in here with empty stack until it had two frames.
I see this function is only used for extending of the test object, so I will poke around that function until I figure out the exact place. |
In CI pretty often pirates library throws error with its source code, but doesn't really say much about the filename where it happened.
Locally It happens once in thousands times so I cannot really debug it locally to reproduce it.
Is it possible to extend the error message to show the file name if pirates hook fails? or to provide at least bit more context.
This is bothering us for a very long time now, especially since we cannot reproduce it and it happens almost exclusively in CI.
Our node version in CI is 16.5.2
The text was updated successfully, but these errors were encountered: