You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
testCheckUpdate fails on Owncloud external storage type #38731
We are getting this running in CI again after a long time. See issue #34735
It runs, but we get this 1 unit test failure. Maybe this is a real failure?
The test is:
/**
* Test whether checkUpdate properly returns false when there was
* no change.
*/
public function testCheckUpdate() {
if ($this->instance instanceof \OC\Files\Storage\Wrapper\Wrapper) {
$this->markTestSkipped('Cannot test update check on wrappers');
}
$textFile = \OC::$SERVERROOT . '/tests/data/lorem.txt';
$watcher = $this->instance->getWatcher();
$watcher->setPolicy(Watcher::CHECK_ALWAYS);
$this->instance->file_put_contents('/lorem.txt', \file_get_contents($textFile));
$this->assertTrue($watcher->checkUpdate('/lorem.txt'), 'Update detected');
$this->assertFalse($watcher->checkUpdate('/lorem.txt'), 'No update');
}
And it fails at the last assertFalse
I will put in an appropriate markTestSkipped for now, so that the other tests can be run regularly in CI.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.
I added the bug label so that the bot does not close this. Someone should investigate - it might just be a test issue, or there might be a real issue with the code-under-test.
🤖 Automated issue triage by Claude Code review agent.
I investigated this and the situation is still live: the test is skipped, not fixed. On the current default branch the skip is in the shared base test class, not in OwncloudTest:
tests/lib/Files/Storage/Storage.php:342-344 — testCheckUpdate() calls markTestSkipped('Skip testCheckUpdate on OwncloudTest see issue 38371') whenever $this instanceof \OCA\Files_External\Tests\Storage\OwncloudTest. (The 38371 in that message is a typo — it refers to this issue, testCheckUpdate fails on Owncloud external storage type #38731.)
The skip was introduced in PR #38354 (commit d2230f9) to unblock CI for the rest of the suite. So the failure is masked, not resolved.
The OwnCloud external-storage backend is WebDAV-based — OCA\Files_External\Lib\Storage\OwnCloud extends \OC\Files\Storage\DAV (apps/files_external/lib/Lib/Storage/OwnCloud.php:34). With Watcher::CHECK_ALWAYS, every checkUpdate evaluates:
The mtime here comes from the remote DAV server's {DAV:}getlastmodified header, parsed via \strtotime(...) (lib/private/Files/Storage/DAV.php:481, :620, :836). That value has whole-second (HTTP-date) resolution and is produced by the remote server's clock/propagation, whereas storage_mtime cached after the upload is the value seen at write time.
For native local backends filemtime and the cached storage_mtime agree exactly, so the second hasUpdated returns false → assertFalse passes. For the DAV/ownCloud backend the remote getlastmodified the second time can be strictly greater than the cached storage_mtime (second-rounding boundary + remote mtime not being byte-identical to the locally cached value), so filemtime() > $time is true → checkUpdate returns true → assertFalse(..., 'No update') fails with exactly the reported Failed asserting that true is false. at tests/lib/Files/Storage/Storage.php:347 (now :350).
In short: this is a DAV-mtime-resolution / propagation interaction with CHECK_ALWAYS, not a regression in business logic. It is essentially a test that does not account for the second-granularity, server-authoritative mtime of WebDAV-backed storages.
Suggested resolution
Two reasonable paths (a maintainer call):
Keep the skip but make it explicit and correct — move the skip into OwncloudTest itself (or DAV-based tests generally) with a comment explaining DAV second-resolution mtime, and fix the stale 38371 → 38731 reference.
Make the test mtime-tolerant for DAV backends — e.g. allow a small mtime tolerance / re-stat-after-cache for storages whose mtime is second-granular, so the "no change" check is stable.
Given the backend is still present and shipped, option 2 is the more correct fix, but it's a behavioral decision for the files_external owners.
Note: removing the test skip code at the moment does not really enable anything. Unit tests were run in drone with different backend storage in place (rather than just wrappers that simulate what storage "should" do). Those unit test pipelines for webdav, sftp, owncloud and samba have not yet been ported to GitHub workflows.
After they are running in GitHub workflows, then we can try enabling this skipped test.
🤖 Automated issue triage by Claude Code review agent.
Thanks @phil-davis — that context changes the picture. Agreed: removing the markTestSkipped right now wouldn't actually exercise the ownCloud (DAV) backend, since testCheckUpdate currently runs only against wrapper storages that simulate expected behaviour. The real-backend unit-test pipelines (webdav, sftp, owncloud, samba) that used to run in Drone haven't been ported to GitHub workflows yet, so there's nothing to enable against.
So this isn't actionable as a code fix today. The previously located root cause still appears to hold and is worth keeping on record for when the test is re-enabled:
The skip lives in the shared base class — tests/lib/Files/Storage/Storage.phptestCheckUpdate() skips when $this instanceof \OCA\Files_External\Tests\Storage\OwncloudTest (the 38371 in the skip message is a typo for testCheckUpdate fails on Owncloud external storage type #38731).
The likely cause is the DAV backend's second-granularity, server-authoritative {DAV:}getlastmodified mtime interacting with Watcher::CHECK_ALWAYS: the second checkUpdate can see a remote mtime strictly greater than the cached storage_mtime, so Common::hasUpdated() (filemtime() > $time) re-fires and assertFalse(..., 'No update') fails.
Recommended next step (no fix needed now): keep this open as a tracker, and once the backend-storage unit-test pipelines are running in GitHub Actions, un-skip testCheckUpdate for the ownCloud backend and confirm whether it's a genuine bug or a test that needs to tolerate second-resolution DAV mtimes. No further automated action on my side until then.
Before this can be acted on, the following needs to be resolved:
Not actionable yet: testCheckUpdate is currently skipped for the OwncloudTest (DAV-backed) storage test via tests/lib/Files/Storage/Storage.php, and per the maintainer's 2026-06-24 comment, the real-backend unit-test pipelines (webdav, sftp, owncloud, samba) needed to exercise this path haven't been ported from Drone to GitHub Actions yet — there is nothing to run a fix against right now.
Decision needed once that infra is ready: should the fix (a) make the base test's second checkUpdate assertion tolerant of the DAV backend's second-granularity, server-authoritative mtime, or (b) keep an explicit, correctly-referenced skip for DAV-backed storages? These are different changes to tests/lib/Files/Storage/Storage.php.
Blocked on: the webdav/sftp/owncloud/samba backend-storage unit-test pipelines landing in GitHub Actions CI.
Activity
phil-davis commentedon May 13, 2021
We are getting this running in CI again after a long time. See issue #34735
It runs, but we get this 1 unit test failure. Maybe this is a real failure?
The test is:
And it fails at the last
assertFalseI will put in an appropriate
markTestSkippedfor now, so that the other tests can be run regularly in CI.github-actions commentedon Nov 10, 2021
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.
github-actions commentedon Nov 21, 2021
This issue has been automatically closed.
phil-davis commentedon Nov 21, 2021
The test skip is commit d2230f9
phil-davis commentedon Nov 21, 2021
I added the bug label so that the bot does not close this. Someone should investigate - it might just be a test issue, or there might be a real issue with the code-under-test.
DeepDiver1975 commentedon Jun 22, 2026
🤖 Automated issue triage by Claude Code review agent.
I investigated this and the situation is still live: the test is skipped, not fixed. On the current default branch the skip is in the shared base test class, not in
OwncloudTest:tests/lib/Files/Storage/Storage.php:342-344—testCheckUpdate()callsmarkTestSkipped('Skip testCheckUpdate on OwncloudTest see issue 38371')whenever$this instanceof \OCA\Files_External\Tests\Storage\OwncloudTest. (The38371in that message is a typo — it refers to this issue, testCheckUpdate fails on Owncloud external storage type #38731.)The skip was introduced in PR #38354 (commit
d2230f9) to unblock CI for the rest of the suite. So the failure is masked, not resolved.Located root cause
The failing assertion is the second
checkUpdate:The
OwnCloudexternal-storage backend is WebDAV-based —OCA\Files_External\Lib\Storage\OwnCloud extends \OC\Files\Storage\DAV(apps/files_external/lib/Lib/Storage/OwnCloud.php:34). WithWatcher::CHECK_ALWAYS, everycheckUpdateevaluates:Watcher::needsUpdate()→storage->hasUpdated($path, $cachedData['storage_mtime'])(lib/private/Files/Cache/Watcher.php:122-130)Common::hasUpdated()→return $this->filemtime($path) > $time;(lib/private/Files/Storage/Common.php:325)The mtime here comes from the remote DAV server's
{DAV:}getlastmodifiedheader, parsed via\strtotime(...)(lib/private/Files/Storage/DAV.php:481,:620,:836). That value has whole-second (HTTP-date) resolution and is produced by the remote server's clock/propagation, whereasstorage_mtimecached after the upload is the value seen at write time.For native local backends
filemtimeand the cachedstorage_mtimeagree exactly, so the secondhasUpdatedreturns false →assertFalsepasses. For the DAV/ownCloud backend the remotegetlastmodifiedthe second time can be strictly greater than the cachedstorage_mtime(second-rounding boundary + remote mtime not being byte-identical to the locally cached value), sofilemtime() > $timeis true →checkUpdatereturns true →assertFalse(..., 'No update')fails with exactly the reportedFailed asserting that true is false.attests/lib/Files/Storage/Storage.php:347(now :350).In short: this is a DAV-mtime-resolution / propagation interaction with
CHECK_ALWAYS, not a regression in business logic. It is essentially a test that does not account for the second-granularity, server-authoritative mtime of WebDAV-backed storages.Suggested resolution
Two reasonable paths (a maintainer call):
OwncloudTestitself (orDAV-based tests generally) with a comment explaining DAV second-resolution mtime, and fix the stale38371→38731reference.Given the backend is still present and shipped, option 2 is the more correct fix, but it's a behavioral decision for the files_external owners.
phil-davis commentedon Jun 24, 2026
Note: removing the test skip code at the moment does not really enable anything. Unit tests were run in drone with different backend storage in place (rather than just wrappers that simulate what storage "should" do). Those unit test pipelines for
webdav,sftp,owncloudandsambahave not yet been ported to GitHub workflows.After they are running in GitHub workflows, then we can try enabling this skipped test.
DeepDiver1975 commentedon Jun 24, 2026
🤖 Automated issue triage by Claude Code review agent.
Thanks @phil-davis — that context changes the picture. Agreed: removing the
markTestSkippedright now wouldn't actually exercise the ownCloud (DAV) backend, sincetestCheckUpdatecurrently runs only against wrapper storages that simulate expected behaviour. The real-backend unit-test pipelines (webdav,sftp,owncloud,samba) that used to run in Drone haven't been ported to GitHub workflows yet, so there's nothing to enable against.So this isn't actionable as a code fix today. The previously located root cause still appears to hold and is worth keeping on record for when the test is re-enabled:
tests/lib/Files/Storage/Storage.phptestCheckUpdate()skips when$this instanceof \OCA\Files_External\Tests\Storage\OwncloudTest(the38371in the skip message is a typo for testCheckUpdate fails on Owncloud external storage type #38731).{DAV:}getlastmodifiedmtime interacting withWatcher::CHECK_ALWAYS: the secondcheckUpdatecan see a remote mtime strictly greater than the cachedstorage_mtime, soCommon::hasUpdated()(filemtime() > $time) re-fires andassertFalse(..., 'No update')fails.Recommended next step (no fix needed now): keep this open as a tracker, and once the backend-storage unit-test pipelines are running in GitHub Actions, un-skip
testCheckUpdatefor the ownCloud backend and confirm whether it's a genuine bug or a test that needs to tolerate second-resolution DAV mtimes. No further automated action on my side until then.dj4oC commentedon Jul 8, 2026
Before this can be acted on, the following needs to be resolved:
testCheckUpdateis currently skipped for theOwncloudTest(DAV-backed) storage test viatests/lib/Files/Storage/Storage.php, and per the maintainer's 2026-06-24 comment, the real-backend unit-test pipelines (webdav,sftp,owncloud,samba) needed to exercise this path haven't been ported from Drone to GitHub Actions yet — there is nothing to run a fix against right now.checkUpdateassertion tolerant of the DAV backend's second-granularity, server-authoritative mtime, or (b) keep an explicit, correctly-referenced skip for DAV-backed storages? These are different changes totests/lib/Files/Storage/Storage.php.webdav/sftp/owncloud/sambabackend-storage unit-test pipelines landing in GitHub Actions CI.🤖 Automated by Claude Code
Generated by Claude Code