spryker / docker-sdk

Spryker Commerce OS - Docker SDK
https://spryker.com
Other
36 stars 47 forks source link

Sporadical WebDriver timeout in acceptance tests #396

Closed kj187 closed 1 year ago

kj187 commented 1 year ago

Which release, branch or hash of Docker SDK are you using?

master

Which operating system (platform/version/architecture) are you using?

ubuntu-18.04 on GitHub Actions

What is the issue that you're experiencing?

The following error happens only sporadically, after a restart of the failed job it works without any issues. In this case it was happen on Alpine, but it could also happen on Debian. Its totally sporadical. Also the test case, in this example it is CmsGuiCreatePageCest but it could also be another test case.

https://github.com/elmerdigital/b2b-demo-shop/actions/runs/3540552778/jobs/5943741993

SCR-20221124-jtb

What are the steps to reproduce the issue?

I forked the current Spryker Demo Shop (https://github.com/elmerdigital/b2b-demo-shop). The github CI which I use is the following (https://github.com/elmerdigital/b2b-demo-shop/blob/master/.github/workflows/ci.yml)

git clone https://github.com/spryker/docker-sdk.git ./docker
docker/sdk boot -v deploy.ci.acceptance.mariadb.yml
docker/sdk up -t
docker/sdk testing console queue:worker:start --stop-when-empty
docker/sdk testing codecept run -c codeception.acceptance.yml

What is the expected result of these steps in the absence of the issue?

A successful Github job

kj187 commented 1 year ago

Here another example from a project where we use Gitlab CI

SCR-20221124-lu5

RozbehSharahi commented 1 year ago

Hello,

For more convenient investigation, I want to provide some further hints here:

The issue seems to only appear on usage of spryker/chromedriver which uses chrome version 102. Therefore it is necessary to add it to deploy.*.yml for reproduction.

services:
    webdriver:
        engine: chromedriver

Reproduction is easily done also on local machines by running a simple test 10 times:

for i in `seq 1 10`; do docker/sdk testing codecept run -g CompanyRegistrationCest; done

10 times in my case is already enough to always have a stuck test.

The test will get stuck for 600secs (i think curl timeouts are not correctly set) until it will follows up with the above mentioned error message.

Hint: I think an update of chrome version might solve the issue.

<3

RozbehSharahi commented 1 year ago

The problem seems really to be chrome version related. With following steps I tried with a new version (108).

It is necessary to call once docker/sdk cli console c:c:b otherwise test will fail on fresh setup

Now that chromedriver is updated, I update chrome manually in webdriver container

After that the session issue does not appear anymore:

for i in `seq 1 100`; do docker/sdk testing codecept run -g CompanyRegistrationCest; done
alexanderM91 commented 1 year ago

Hi @RozbehSharahi, great and thanks a lot for your magnificent and deep investigation. We are planing to handle it in the nearest future.

alexanderM91 commented 1 year ago

Hi, Chromedriver has been updated to 1085359. Please pull the latest image version.

My special gratitude for the contribution in the problem investigation.

Also, let's close an issue and reopen it or create a new one in case of necessity. Thank you.