Skip to content

test(files): fix background scanner paths and ETag propagation checks - #65132

Open
joshtrichards wants to merge 3 commits into
masterfrom
jtr/ScannerTest-fixes
Open

joshtrichards wants to merge 3 commits into
masterfrom
jtr/ScannerTest-fixes

Conversation

@joshtrichards

Copy link
Copy Markdown
Member
  • Resolves: #

Summary

  • Corrected background scan test paths: The background scan tests created files under folder and folder2 but repeated an assertion for folder/bar.txt. Additionally, the pre-scan check used a path that the fixture never created.
  • Unscanned and nested folder ETag verification: The tests didn't assert that newly added files were discovered. The nested-folder test also checked the wrong path. Lastly, it reused the parent folder's cached mtime instead of the subfolder's own cached mtime.

Changes:

  • Fix assertion to check the actual folder2/bar.txt path.
  • Clarify why the tests mark folders as complete or incomplete.
  • Assert that newly added files are correctly cached.
  • Check the nested file at its correct path.
  • Preserve the subfolder's own mtime during the scan.

TODO

  • Backport?

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

When a folder is marked unscanned `(size = -1)`, rescanning must not reuse its cached ETag. Changes to a nested folder's ETag must also propagate to its ancestors.

The tests didn't verify that newly added files were discovered. The
nested-folder test also checked the wrong path and restored the
subfolder's mtime from its parent instead of its own cached mtime.

- Assert newly added files are cached
- Check the nested file at its correct path
- Preserve the subfolder's own mtime during the scan

Signed-off-by: Josh <josh.t.richards@gmail.com>
The tests create files under `folder` and `folder2` but repeat an assertion for `folder/bar.txt`; the pre-scan check also uses a path that the fixture never creates.

The broader behavior still had some coverage, but a narrow cache-entry regression could go unnoticed.

- Check the actual `folder2/bar.txt` path
- Clarify why the tests mark folders complete or incomplete

Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
@joshtrichards joshtrichards added this to the Nextcloud 36 milestone Oct 5, 2026
@joshtrichards
joshtrichards requested a review from a team as a code owner October 5, 2026 13:13
@joshtrichards
joshtrichards requested review from icewind1991 and removed request for a team October 5, 2026 13:13
@joshtrichards joshtrichards added the tests Related to tests label Oct 5, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant