-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
test(files_external): call parent::setUp() in BackendServiceTest - #64174
Open
solracsf wants to merge 1 commit into
Open
test(files_external): call parent::setUp() in BackendServiceTest #64174solracsf wants to merge 1 commit into
solracsf wants to merge 1 commit into
Conversation
BackendServiceTest overrode setUp() without calling the parent, but still ran TestCase::tearDown(). For a test outside the DB group that tearDown re-registers IDBConnection as TestCase::$realDatabase, which only the parent setUp() initialises. When BackendServiceTest was the first non-DB test in a run, $realDatabase stayed null and every later test in the process got a null database connection. This showed up when running apps/files_external/tests/Service on its own: 112 of 138 tests errored with "IDBConnection, null given". The full files_external suite hides it because earlier tests set $realDatabase first. Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
solracsf
requested review from
Altahrim,
come-nc,
icewind1991 and
leftybournes
and removed request for
a team
September 10, 2026 10:18
@solracsf
solracsf
added
3. to review
Waiting for reviews
tests
Related to tests
labels
Sep 10, 2026
solracsf
enabled auto-merge
September 10, 2026 10:18
CarlSchwan
CarlSchwan
approved these changes
Sep 10, 2026
come-nc
come-nc
approved these changes
Sep 10, 2026
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.
BackendServiceTestskippedparent::setUp()but still ranTestCase::tearDown(), which re-registersIDBConnectionasTestCase::$realDatabase. That property is only set in the parentsetUp(), so when this test is the first non-DB test in a run it stays null and every later test gets a null database connection.CI doesn't hit this because the full files_external suite runs other tests first. Running
apps/files_external/tests/Serviceon its own reproduces it: 112 of 138 tests error withIDBConnection, null givenwithout this change, and all pass with it, on MariaDB 11.8 and PostgreSQL 16.