ERR_CONNECTION_REFUSED when running Dusk in CI (Github Actions) #51404
-
We've been experiencing a persistent issue with our dusk tests in CI for over a year. Approximately 95% of the time, a part of our tests fail with the error UnknownErrorException: unknown error: net::ERR_CONNECTION_REFUSED. Interestingly, the initial tests pass without any issues, but about halfway through, the remaining tests consistently encounter this error. Occasionally (about 5% of the time), all tests complete successfully without any errors. Despite several attempts to resolve the issue, we have not yet found a solution, which prevents use to use dusk tests in our CI process. Also, when this initial problem came up, there was no code related change that could've caused this, as the tests randomly started failing with no commit prior. It seems that the issue appears less often when I reduce the number of Dusk tests in our application, although we only use about 9 tests files, which have 26 tests in total. The entire process takes around 5 minutes to complete on GitHub, but this duration is reduced because some tests fail quickly because of mentioned issue. Here's what I've tried so far:
I would appreciate any help or suggestions, as this issue has been quite frustrating and is impacting our QA capabilities for a while now. It's also interesting to me that I couldn't find anyone else struggling with this issue, so it would be really nice to figure this out. In any case, thanks for reading! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Bump |
Beta Was this translation helpful? Give feedback.
We also encountered this issue and lived with it for a few months but it was a reason to not add more dusk tests since it added to the failure rate.
The app is an API which is probably overwhelming the single threaded dev server. Our solution was to just use
octane:start
instead ofserve
but we can only do that since we use Octane, the only other way I can think of solving this would be to actually run your app with FPM as a service within the job.