User tests: Successful: Unsuccessful:
Pull Request for Issue # .
on installation joomla create a SuperUser whose id is generated random(1,1000)
but with postgresql the relative sequence #__users_id_seq
is not setted is still 1, so as soon we create an user
whose id is equal to the id created for the Super User we got duplicate key value violates unique constraint "jos_users_pkey
set the relative sequence #__users_id_seq
after the super user creation
apply pull PR
and run cypress install/installation.cy.js
and the run this test:
scripts/create 52 pgsql
cat > branch_52/tests/System/integration/install/duplicate.cy.js <<EOF
describe('Test duplicate key value error', () => {
it('in creating 1,000 users', () => {
for (let i = 1; i <= 1000; i++) {
cy.db_createUser({username: \`test user \${i}\` });
}
});
});
EOF
scripts/test 52 system install/duplicate.cy.js
duplicate key value violates unique constraint "jos_users_pkey
no more duplicate error
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
Status | New | ⇒ | Pending |
Category | ⇒ | Installation |
Labels |
Added:
PR-5.2-dev
|
✅ Tested succesfully on macOS 👍
scripts/test 52 system tests/System/integration/install/Installation.cy.js,tests/System/integration/install/duplicate.cy.js
scripts/test 52 system
Title |
|
I have tested this item ✅ successfully on a2feb76
I haven't tested as described with Cypress. Instead of this, I have done following.
I've made a new installation of a clean 5.2-dev branch using an empty PostgreSQL database (of course after composer install and npm ci).
Directly after that (no need to login to the backend) I have checked the ID of the superuser and the last value of the "#__users_id_seq" sequence with phpPgAdmin. (Last value is a misleading term because in fact is is the next value.)
Result: The superuser's ID has a value between 1 and 1000, e.g. 362. The last value of the sequence is 1.
Then I have done the same with the branch of this PR under the same starting conditions (clean branch, composer install, npm ci, install into empty PostgreSQL DB).
Result: The superuser's ID has a value between 1 and 1000, e.g. 362. The last value of the sequence is this ID value plus 1, e.g. 363.
Additional test: After the installation and the checks in phpPgAdmin I logged in to the administrator and have created a new user.
Without the PR that new user has ID = 1 (one).
With the PR the new user has ID = ID of the super user plus one.
I have tested this item ✅ successfully on a2feb76
On macOS with JBT created 5.2-dev branch installation with additional test case and run the tests to see the problem:
scripts/create 52 pgsql
cat > branch_52/tests/System/integration/install/duplicate.cy.js <<EOF
describe('Test duplicate key value error', () => {
it('in creating 1,000 users', () => {
for (let i = 1; i <= 1000; i++) {
cy.db_createUser({username: \`test user \${i}\` });
}
});
});
EOF
scripts/test 52 system tests/System/integration/install/Installation.cy.js,tests/System/integration/install/duplicate.cy.js
Problem seen:
1) Test duplicate key value error
in creating 1,000 users:
CypressError: `cy.task('queryDB')` failed with the following error:
> duplicate key value violates unique constraint "jos52_users_pkey"
Checked PR with recreating 5.2-dev branch with additional test case and installing patch tester, applying PR 44324 and running same tests again plus all remaining System Tests:
scripts/create recreate 52 pgsql
scripts/patchtester 52
# Applying PR 44324 in http://host.docker.internal:7052/administrator/index.php?option=com_patchtester
cat > branch_52/tests/System/integration/install/duplicate.cy.js <<EOF
describe('Test duplicate key value error', () => {
it('in creating 1,000 users', () => {
for (let i = 1; i <= 1000; i++) {
cy.db_createUser({username: \`test user \${i}\` });
}
});
});
EOF
scripts/test 52 system tests/System/integration/install/Installation.cy.js,tests/System/integration/install/duplicate.cy.js
scripts/test 52 system
One timeout error and repeated this single test step:
scripts/test system 52 administrator/components/com_cpanel/CPanel.cy.js
All tests are passed successfully 👍
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2024-10-22 11:47:04 |
Closed_By | ⇒ | laoneo |
Good find!