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
Temporary Files #1079
Comments
Playwright Java consists of two parts: java client that provides all the APIs and a driver which is shared between all language ports. The driver is a node.js application which is archived in a maven package and is extracted into a temp directory every time you launch playwright. The directory is automatically deleted after the application finishes. You cannot delete it before you finished running playwright as it will break it. |
Hi @yury-s - This is a bug then as I don't see this getting cleaned up. Is there a way to debug this? Thanks |
The files/dirs are marked as deleteOnExit() so if JVM exits without errors the should be removed. |
They aren't. I have a long running program that's doing multiple searches over many hours and I see left over files like this so for some reason playwright didn't delete the dir containing the node.exe file when it started at 8:13 am and I exited in around 2:30 pm today. @yury-s - Please help me debug this. Why is this happening? Thanks |
It may happen if node.exe didn't exit properly and still holding some of the files. Can you check for remaining node processes after the app exits? Usually Playwright will kill them before exit if the are not responsive but maybe there is a bug. Also, does it happen with a simple scenario that just runs a test and exits? Having a reproducible example would be helpful. |
Try running with
This may be printed if the batch file that we use to launch node is missing, e.g. it was deleted from the temp directory already. |
This is where we construct the file name. You can pause in the debugger there, and check if |
INFO: Closing client connection. Still seeing leftover directories:
Thanks |
This might be created by firefox, playwright itself doesn't create such folder as far as I know.
It means that the node process is still hanging around preventing the directory from being deleted. You should be able to find it in the task manager.
I cannot make sense of it, it looks like you are trying to launch playwright again after the cleanup started. Can it be that there is a periodic job that does temp folder cleanup and interferes with the running Playwright instance? |
Okay so there it is running: I see this: 2022-09-27T18:20:39.625Z pw:install created DriverJar: C:\Users\xxxx\AppData\Local\Temp\playwright-java-7557468934805508290 Then when I quit my application: INFO: Closing client connection. No node.exe: And the folder is still there: There isn't anything deleting directories, etc. from my %temp% directory. |
I have no explanation for that, it should not. Perhaps it's the same code that prints "INFO: Closing client connection." (Playwright doesn't have such messages). Would you be able to share minimal reproducible example? |
INFO: Closing client connection. - Is my code. Based on what I've seen it seems like there are a few issues here. Can you give me another build that has more debugging capabilities? Thanks |
I could but I'm not sure where to put that logging. It seems that the problem is somewhere in the implementation of the Which JVM do you use? |
We need more information to act on this report. Please file a new one and link to this issue when you get back to it! |
@yury-s
|
Hello @yury-s I hope you are well, is there a reason this issue was closed? I can reproduce this consistently on my local setup and in a remote server, I am using Java 11 and 17 and Playwright version 1.37.0. The description provided by @NIKOLENKO-TE above is quite thorough about the problem, do you need more information from our side? |
Please don't comment on the closed issues, we don't monitor them. This one was closed because we were not able to reproduce it and hence could not take any action on it. If you have a good repro, feel free to open a new bug and provide the steps there. |
Using Playwright 1.25 for java on Windows with the Firefox driver.
Using a 1.8 JVM
Seeing lots of temp files leftover:
Why?
And is there a way to delete them before my Playwright application ends?
Thanks
The text was updated successfully, but these errors were encountered: