-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[cypress] PostgreSQL Connection pool for System Tests #43924
Conversation
Merge branch '4.4-dev'
Consider file permissions when writing configuration in system tests …
merge joomla/joomla-cms branch 4.4-dev
merge base 4.4-dev
[4.x] Translation Update (joomla#43518)
merge head-repository joomla/joomla-cms
merge head repository joomla/joomla-cms
merge from head repository
Sometimes single specs in the System Tests fail with: CypressError: `cy.task('queryDB')` failed with the following error: > duplicate key value violates unique constraint "cpostgresmax_users_pkey" The error happens on different specs in System Tests especially running on drone. It could be reproduced in running the System Tests tree times (first with installation, 2nd and 3rd run w/o): npx cypress run npx cypress run --spec 'tests/System/integration/administrator/**/*.cy.{js,jsx,ts,tsx},tests/System/integration/site/**/*.cy.{js,jsx,ts,tsx},tests/System/integration/api/**/*.cy.{js,jsx,ts,tsx},tests/System/integration/plugins/**/*.cy.{js,jsx,ts,tsx}' npx cypress run --spec 'tests/System/integration/administrator/**/*.cy.{js,jsx,ts,tsx},tests/System/integration/site/**/*.cy.{js,jsx,ts,tsx},tests/System/integration/api/**/*.cy.{js,jsx,ts,tsx},tests/System/integration/plugins/**/*.cy.{js,jsx,ts,tsx}' Checking the session usage in pgAdmin shows the maximum number of 100 configured sessions appears to have been reached. Therefore the usage of postgres connection pool is implemented. The session usage is reduced to max 12 and the error could no more reproduced.
- Delete function as only called once - Renamed to postgresConnectionPool Contributed by @laoneo
I am now happy to have a faster Apple M3 for testing, the 4.4-dev system tests (without installation step) run in only 3:10 with mariadbi. And no wonder that the pgsql error appears here too. But this time with a clear error message:
With this PR the system tests are passed in 3:07 for pgsql 😄 |
This PR was successfully tested with pgsql in the current branches 4.4-dev, 5.1-dev, 5.2-dev, 5.3-dev and 6.0-dev. |
Despite the positive tests and good looking charts, the original bug was seen once with
In my opinion, this PR is still useful. Without it, it doesn't work at all on an Apple M3 - you get But, the problem could not be reproduced in 3 complete runs |
Thanks! |
👍 And, definitely it fixes |
caused by joomla#43924
* [cypress] lint mjs files * fix javascript-cs caused by #43924
Summary of Changes
Use Connection pool for PostgreSQL in System Tests.
Sometimes single specs in the System Tests fail with:
The error occurs on various specs in the System Tests, especially when running on drone.
It could be reproduced locally in running the System Tests tree times (first with installation, 2nd and 3rd run w/o):
Checking the session usage in pgAdmin shows the maximum number of 100 (SHOW max_connections) configured sessions appears to have been reached:
Therefore the usage of postgres connection pool is implemented with max 10 connections.
The session usage is reduced to max 12 and the error could no more reproduced:
Testing Instructions
Having Joomla instance running with PostgreSQL (PDO). Running System Tests and check Sessions tab in
pgAdmin
.Actual result BEFORE applying this Pull Request
Heavy session usage during the System Tests. System Tests have sometimes the error
duplicate key value violates unique constraint "cpostgresmax_users_pkey"
.Expected result AFTER applying this Pull Request
Maximum number of 12 sessions used during the System Tests. System Tests running with all specs passed.
Link to documentations
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed