Commit 92809c3
committed
fix(test): stabilise flaky DB and quota tests
- Quota::fopen: when free_space() returns SPACE_NOT_COMPUTED the previous
code skipped wrapping the stream entirely, letting unlimited writes
through. Now wraps with the full quota as a conservative ceiling, which
makes testStreamCopyNotEnoughSpace deterministic regardless of whether
the cache has a valid root-size entry.
- CleanupShareTargetTest::setUp: call getUserFolder()->getDirectoryListing()
for every test user so their home folders are in the filecache before
any share operations. tearDown wipes filecache; without this
getShareById (which JOINs on filecache) throws ShareNotFound
intermittently on the second createUserShare call.
- DBConfigServiceTest::setUp: remove any mounts left by a previously
failed test run so testSetMountPoint and testGetAllMounts do not see
unexpected extra rows.
- StoragesServiceTestCase / CleaningDBConfig: add cleanAll() that removes
every mount from the DB (not just those tracked by the current instance)
and call it at the top of setUp so testGetStoragesBackendNotVisible and
testGetStoragesAuthMechanismNotVisible start with an empty external
mount table.
Signed-off-by: Anna Larch <anna@nextcloud.com>
AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent c789ec1 commit 92809c3
4 files changed
Lines changed: 22 additions & 3 deletions
File tree
- apps
- files_external/tests/Service
- files_sharing/tests/Repair
- lib/private/Files/Storage/Wrapper
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
29 | 33 | | |
30 | 34 | | |
31 | 35 | | |
| |||
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
54 | 61 | | |
55 | 62 | | |
56 | 63 | | |
| |||
66 | 73 | | |
67 | 74 | | |
68 | 75 | | |
| 76 | + | |
69 | 77 | | |
70 | 78 | | |
71 | 79 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
30 | 35 | | |
31 | 36 | | |
32 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
136 | | - | |
137 | | - | |
| 135 | + | |
| 136 | + | |
138 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
139 | 141 | | |
140 | 142 | | |
141 | 143 | | |
| |||
0 commit comments