test(db): call parent::tearDown() in DB test classes that skipped it#60744
Draft
miaulalala wants to merge 1 commit into
Draft
test(db): call parent::tearDown() in DB test classes that skipped it#60744miaulalala wants to merge 1 commit into
miaulalala wants to merge 1 commit into
Conversation
Eight test classes overrode tearDown() for custom DB cleanup but never called parent::tearDown(). TestCase::tearDown() does three things these tests were silently skipping after every test method: - ILockingProvider::releaseAll() — unreleased locks bleed into subsequent tests and can cause deadlocks or unexpected NotFoundException - Storage::getGlobalCache()->clearCache() — stale filecache entries from share/storage tests cause unrelated ObjectStore tests to receive false from fopen() (fseek() then fails with "Argument must be of type resource") - UserMountCache::flush() — stale mount cache causes share lookups in later tests to fail with ShareNotFound AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Anna Larch <anna@nextcloud.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Eight test classes in
tests/lib/overridetearDown()for custom DB cleanup but never callparent::tearDown().Why
TestCase::tearDown()does three things these tests were silently skipping after every single test method:ILockingProvider::releaseAll()— unreleased locks bleed into subsequent tests, causing unexpected deadlocks orNotFoundExceptionStorage::getGlobalCache()->clearCache()— stale filecache entries left behind by share/storage tests cause completely unrelatedObjectStoreStorageTesttests to receivefalsefromfopen(), which then makesfseek()fail with "Argument Name the repository "server" #1 must be of type resource, bool given"UserMountCache::flush()— stale mount cache causes share lookups in later tests to fail withShareNotFoundThese are the root causes of two recurring flaky failures seen in CI:
Test\Files\ObjectStore\ObjectStoreStorageTest::testFseekSizeTest\Share20\DefaultShareProviderTest::testDeleteSingleShareLazyFiles changed
tests/lib/Share20/DefaultShareProviderTest.phptests/lib/Share20/ShareByMailProviderTest.phptests/lib/Files/Config/UserMountCacheTest.phptests/lib/SubAdminTest.phptests/lib/Files/Type/LoaderTest.phptests/lib/Calendar/ResourcesRoomsUpdaterTest.phptests/lib/Preview/PreviewMigrationJobTest.phptests/lib/DB/AdapterTest.phpTest plan
🤖 Generated with Claude Code