Skip to content
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

Unset class vars in test teardown #866

Merged
merged 1 commit into from
Feb 21, 2024

Conversation

Peterburnett
Copy link
Contributor

Before:

There were 3 failures:

1) tool_dataflows\tool_dataflows_connector_compression_test::test_gzip_compression_decompression
Property 'basedir' defined in 'tool_dataflows\tool_dataflows_connector_compression_test' was not reset after the test!
Please either find a way to avoid using a class variable or make sure it get's unset in the tearDown method to avoid creating memory leaks.

/var/www/site/server/lib/phpunit/classes/testcase.php:623
/var/www/sit/server/lib/phpunit/classes/testcase.php:148

2) tool_dataflows\tool_dataflows_connector_compression_test::test_gzip_validation
Property 'basedir' defined in 'tool_dataflows\tool_dataflows_connector_compression_test' was not reset after the test!
Please either find a way to avoid using a class variable or make sure it get's unset in the tearDown method to avoid creating memory leaks.

/var/www/site/server/lib/phpunit/classes/testcase.php:623
/var/www/site/server/lib/phpunit/classes/testcase.php:148

3) tool_dataflows\tool_dataflows_flow_compression_test::test_gzip_compression_decompression
Property 'readdir' defined in 'tool_dataflows\tool_dataflows_flow_compression_test' was not reset after the test!
Please either find a way to avoid using a class variable or make sure it get's unset in the tearDown method to avoid creating memory leaks.

/var/www/site/server/lib/phpunit/classes/testcase.php:623
/var/www/site/server/lib/phpunit/classes/testcase.php:148

After:

OK, but incomplete, skipped, or risky tests!
Tests: 328, Assertions: 744, Skipped: 1.

@matthewhilton matthewhilton merged commit 7a83148 into MOODLE_401_STABLE Feb 21, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants