seleniumhq-community / docker-seleniarm

Multi-Arch (arm64/armhf/amd64) Docker images for the Selenium Grid Server
https://hub.docker.com/u/seleniarm
Other
249 stars 26 forks source link

[🐛 Bug]: PHPUnit unable to establish session with latest version of docker-seleniarm #68

Open bkline opened 5 months ago

bkline commented 5 months ago

What happened?

This is a followup for issue #33. @jamesmortensen has said we should reopen that issue if I was able to come up with a simpler repro case (which I have done), but I don't see any way to reopen the issue, so I'm following the conflicting instructions to open a new ticket instead, as I was unable to find a way to ask James how to proceed (other than posting on X, which didn't seem quite right). Instructions for demonstrating successful (with older version of the image) and unsuccessful (with the current version) session requests are provided in the next field.

(By the way, James, GitHub thinks you're in Chattanooga, but X has you in Chennai. We just got back from visiting our son and his family in Chattanooga, and helping them with spring plantings in their new house. Nice town!)

session-test.tgz

Command used to start Selenium Grid with Docker (or Kubernetes)

# Start the older version of the Docker image.
docker run --rm -it -p 4445:4444 -p 5901:5900 --shm-size 2g seleniarm/standalone-chromium:4.1.4-20220429
# From a separate terminal window, request a session (completes in about 1/2 second).
# Output is shown in attached session-test-success.out, with HTTP code 200, and
# a response body which includes a valid session ID.
php session-test.php
# Stop the container (control+C) in the first terminal window, and start a fresh container
# with the current version of the image.
docker run --rm -it -p 4445:4444 -p 5901:5900 --shm-size 2g seleniarm/standalone-chromium:latest
# Back to the second terminal window, running the same PHP script.
# After five minutes, a 500 error will be returned.
php session-test.php

Relevant log output

See attached logs.

Operating System

Mac M1 Pro Sonoma 14.4

Docker Selenium version (image tag)

seleniarm-v4.18.0-20240221

Selenium Grid chart version (chart version)

N/A

bkline commented 5 months ago

Is it possible, @jamesmortensen, that when you wrote

When I try to execute the tests, it seems nothing at all happens. Everything appears to hang:

in issue #33, you were experiencing the five-minute delay introduced by the Selenium container before it returns a 500 HTTP error response to the request for a session (as described above)? It wasn't clear from that comment whether you had tried running the tests with the earlier version of docker-seleniarm but I would assume not.

bkline commented 5 months ago

The PHP script that you'll find in the attached TAR file (and which you'll run to reproduce the reported behavior) was created by spelunking through the Drupal/PHPUnit source code to determine exactly where the failure occurred, and exactly what the testing container sends to the selenium container at that point in the process, as well as exactly how it sends it.

bkline commented 5 months ago

You can reduce the amount of time you have to wait for the failure by lowering the session timeout.

docker run --rm -it -p 4445:4444 -e "SE_SESSION_REQUEST_TIMEOUT=5" seleniarm/standalone-chromium
bkline commented 5 months ago

Here are logs from the containers for a successful and a failed test (the logs included in the original TAR file were from the test PHP script's output, not the containers).

docker-seleniarm-failed.log docker-seleniarm-ok.log