Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
3.3.3, 3.4, 3.4.3
-
MOODLE_33_STABLE, MOODLE_34_STABLE
-
MOODLE_34_STABLE
-
Hide
(from original issue)
This test covers only the lines where I changed existing code (mainly to make it close recordsets). The idea is to exercise all those places in case some of them are missed by automated testing.
It requires a Moodle setup that is configured to run Behat and with CLI access. You should probably be using Postgres.
A) Default run, without any specific configuration (fetchbuffersize = 0)
For the actual recordset behaviour, these tests will also exercise recordsets, but the unit tests (for this and for code that uses recordets) should be sufficient anyway.
- On the command line, run admin/cli/fix_deleted_users.php
- Confirm script runs without error (it normally gives 2 lines of output and finishes)
- Visit admin/tool/messageinbound/index.php
- Confirm page loads without error
- Visit admin/tool/spamcleaner/index.php
- Search for the keyword 'special' (this is usually found in the guest user profile)
- Confirm page displays list of users without error
- Set up a test account with manager role at site level
- Log in as this test account and go to /cohort/
- Click on 'All cohorts' tab
- Confirm the page displays with no error (it's ok if there aren't any cohorts)
- Log back in as administrator
- Go to or create an Assignment
- Go to the 'Advanced grading' page
- Change grading method to 'Marking guide'
- Define new grading form from scratch
- Fill in the name and the fields for the one existing criterion, then click 'save and make it ready'
- As a test student account on the course, submit something to the assignment
- Back as the administrator, view all submissions and click 'Grade' next to the test student
- Type in a message and score and save the grade
- Log in as the test student account and go to the assignment
- Confirm the grading criteria shows (with the message and score) with no error
- Back as administrator, go to the gradebook for the course
- Click 'Single view' from the dropdown
- Confirm page displays with no error (it's OK if it is blank)
- From the course settings, choose 'Reset'
- Under 'Groups', show more, then choose 'Delete all groups' and 'Delete all groupings'
- Press 'Reset course'
- Confirm the 'Reset course' screen displays with no errors (you do not need to continue past this point)
- Go to the reset screen again.
- Under 'Groups', show more, then choose 'Remove all groups from groupings'
- Press 'Reset course'
- Confirm the 'Reset course' screen displays with no errors (you do not need to continue past this point)
- Go to any course page
- Confirm the course page displays with no errors (this is checking the load_blocks change)
- On the command line, run php admin/tool/behat/cli/util.php --drop
- Now run php admin/tool/behat/cli/init.php
- Confirm the database tables installation completes successfully, ending with the line 'Acceptance tests environment enabled on...' (this checks the message/inbound/manager.php change)
- If using Boost, switch to another theme with normal navigation block such as Clean
- If you have only one course category, create a second category and put at least one course into it
- Go to the course page for a course in one category
- The other category should be visible in navigation, but not expanded. Click to expand it
- Confirm the category expands successfully, showing the courses within it
- (You can now set the theme back, if you like.)
- Add a glossary to a course, with default settings
- Add one entry to the glossary
- Do a search for the entry you just added (ie search for its name)
- Confirm there is no error displayed
- Create a new wiki with default settings
- Create the first page and save it
- Edit the page, change text and save again
- Go to Administration tab and choose Delete page versions
- Select version 2 and press Delete page versions button
- Confirm the version was deleted (page goes back to previous text) and no error message
- From the course menu, go to the question bank Questions page
- Add a question (any type, true/false is easy) and save it
- Confirm that the page displays OK listing the question you just added, with no error
- Hack the URL to change or set the parmater qpage=1, then reload the page
- Confirm that the page is unchanged i.e. it basically ignored the invalid page number, with no error message
- Go to the 'Security overview' report (/report/security/)
- Click the 'Backup of user data' link
- Confirm that the page displays with no error
B) Custom run, with an extreme fetch buffer in action.
- Set $CFG->dboptions['fetchbuffersize'] = 5; in your config.php file. Note this is an extreme value, not suitable for production, but will make the new code to be exercised a lot.
- Repeat all the steps in the previous A) section.
Show(from original issue) This test covers only the lines where I changed existing code (mainly to make it close recordsets). The idea is to exercise all those places in case some of them are missed by automated testing. It requires a Moodle setup that is configured to run Behat and with CLI access. You should probably be using Postgres. A) Default run, without any specific configuration (fetchbuffersize = 0) For the actual recordset behaviour, these tests will also exercise recordsets, but the unit tests (for this and for code that uses recordets) should be sufficient anyway. On the command line, run admin/cli/fix_deleted_users.php Confirm script runs without error (it normally gives 2 lines of output and finishes) Visit admin/tool/messageinbound/index.php Confirm page loads without error Visit admin/tool/spamcleaner/index.php Search for the keyword 'special' (this is usually found in the guest user profile) Confirm page displays list of users without error Set up a test account with manager role at site level Log in as this test account and go to /cohort/ Click on 'All cohorts' tab Confirm the page displays with no error (it's ok if there aren't any cohorts) Log back in as administrator Go to or create an Assignment Go to the 'Advanced grading' page Change grading method to 'Marking guide' Define new grading form from scratch Fill in the name and the fields for the one existing criterion, then click 'save and make it ready' As a test student account on the course, submit something to the assignment Back as the administrator, view all submissions and click 'Grade' next to the test student Type in a message and score and save the grade Log in as the test student account and go to the assignment Confirm the grading criteria shows (with the message and score) with no error Back as administrator, go to the gradebook for the course Click 'Single view' from the dropdown Confirm page displays with no error (it's OK if it is blank) From the course settings, choose 'Reset' Under 'Groups', show more, then choose 'Delete all groups' and 'Delete all groupings' Press 'Reset course' Confirm the 'Reset course' screen displays with no errors (you do not need to continue past this point) Go to the reset screen again. Under 'Groups', show more, then choose 'Remove all groups from groupings' Press 'Reset course' Confirm the 'Reset course' screen displays with no errors (you do not need to continue past this point) Go to any course page Confirm the course page displays with no errors (this is checking the load_blocks change) On the command line, run php admin/tool/behat/cli/util.php --drop Now run php admin/tool/behat/cli/init.php Confirm the database tables installation completes successfully, ending with the line 'Acceptance tests environment enabled on...' (this checks the message/inbound/manager.php change) If using Boost, switch to another theme with normal navigation block such as Clean If you have only one course category, create a second category and put at least one course into it Go to the course page for a course in one category The other category should be visible in navigation, but not expanded. Click to expand it Confirm the category expands successfully, showing the courses within it (You can now set the theme back, if you like.) Add a glossary to a course, with default settings Add one entry to the glossary Do a search for the entry you just added (ie search for its name) Confirm there is no error displayed Create a new wiki with default settings Create the first page and save it Edit the page, change text and save again Go to Administration tab and choose Delete page versions Select version 2 and press Delete page versions button Confirm the version was deleted (page goes back to previous text) and no error message From the course menu, go to the question bank Questions page Add a question (any type, true/false is easy) and save it Confirm that the page displays OK listing the question you just added, with no error Hack the URL to change or set the parmater qpage=1, then reload the page Confirm that the page is unchanged i.e. it basically ignored the invalid page number, with no error message Go to the 'Security overview' report (/report/security/) Click the 'Backup of user data' link Confirm that the page displays with no error B) Custom run, with an extreme fetch buffer in action. Set $CFG->dboptions ['fetchbuffersize'] = 5; in your config.php file. Note this is an extreme value, not suitable for production, but will make the new code to be exercised a lot. Repeat all the steps in the previous A) section. - On the command line, run admin/cli/fix_deleted_users.php
Description
This is a backport of MDL-60174. The rationale for backport is that MDL-60174 is a bug fix, but was slightly risky and had some implications for admins (the change is incompatible with pgbouncer + transaction pooling). We have never said we support pgbouncer, but we know it is used already. Moodle cloud is not affected (uses pgbouncer with session pooling which is fine).
Attachments
Issue Links
- has a non-specific relationship to
-
MDL-60174 get_recordset methods load entire result set into memory in Postgres
-
- Closed
-