Skip to content
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

Sessions randomly stuck #398

Open
alex-buyanov opened this issue Oct 9, 2023 · 4 comments
Open

Sessions randomly stuck #398

alex-buyanov opened this issue Oct 9, 2023 · 4 comments

Comments

@alex-buyanov
Copy link

TLDR: when I am running tests on Moon, oftentimes they get stuck. In VNC, I see that browser is open and page is loaded but test is doing nothing.

I use Playwright Java + TestNG. What happens is that usually tests start okay, but at some point one or two sessions just stay there in Moon doing nothing. It is important to note, that tests are running in parallel with @DataProviders also set to parallel executions. Each test gets its browser from a "browser pool": Java hashmap which allows access by only one thread at a time.

When tests get stuck, I can check running processes and see if nodejs instances spawned by Playwright are still there. If I kill stuck processes, then Playwright obviously fails the test, because connection to browser is broken.

I thought that this is caused by Playwright itself, but that is not true: running tests in local browsers never fails and no browsers get stuck.

The fact that I fail to see the pattern makes the issue harder: it is a new random test every time, whose session gets stuck :(

Appreciate any advice on debugging this.

PS: can't share the repo, and even if I could, you won't be able to connect to company's Moon.

@vania-pooh
Copy link
Member

@alex-buyanov is your Java code finishing its work? Moon closes Playwright sessions only when respective web-socket connection from your code is closed. If your code is stuck, then Moon session will be stuck too until you stop this code.

@alex-buyanov
Copy link
Author

alex-buyanov commented Oct 10, 2023

Nope. That's exactly the problem: a random test (or a couple of them) just get stuck during interactions between Playwright and Moon indefinitely.

I suspect that there is some kind of clash between TestNG threading model, Playwright Java and Moon. And I have no idea how to troubleshoot this :D

Running tests sequentially (non-parallel) eliminates the issue, but that's not a solution. Running tests without Moon also helps, but this is not a solution either.

I thought maybe somebody else have seen such an issue, but Google has failed me.

@vania-pooh
Copy link
Member

@alex-buyanov what is the version of playwright-java library and what playwright version do you request in Moon URL? Both versions should match.

@alex-buyanov
Copy link
Author

I use Playwright 1.38.0 as of now. And I request the same version from Moon: I made sure versions are the same by checking the test code + actually looking at Moon's GUI (sessions have labels with Playwright version). Everything matches.

I also tried using older versions of Playwright, but that did not have any effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants