-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Newdav maintenancemode #27821
Newdav maintenancemode #27821
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤕
Works for me |
tests/integration/config/behat.yml
Outdated
@@ -13,15 +13,15 @@ default: | |||
- admin | |||
regular_user_password: 123456 | |||
mailhog_url: http://127.0.0.1:8025/api/v2/messages | |||
- CommandLineContext: | |||
baseUrl: http://localhost:8080 | |||
ocPath: ../../ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clever!
f38dba5
to
41ecb37
Compare
Rebased for CI |
|
one more remaining, will have a look:
|
boohoo the tests from this file pass locally |
more exact output from Jenkins (which I do not see locally):
|
It is connecting using "admin" but you have changed it here 4787fb7#diff-dc84a6418f59a28b93942dd9dd005b6bR842 |
@SergioBertolinSG but then it should fail locally ? Are you able to reproduce it ? |
Connecting as "admin" in the maintenance tests is the correct scenario. Tried re-checking out the branch locally, removing all extra apps, the test still doesn't fail. |
Nevermind my previous comment. It is working fine for me:
|
I can reproduce this moving this scenario https://github.com/owncloud/core/pull/27821/files#diff-0d2db90e35aaf54e2c763f470420c026R547 into webdav-related-old-endpoint.feature. I think the problem happens when running all the tests together. When running isolated it doesn't fail. |
So it's likely a side effect ? Maybe in some case the maintenance mode isn't properly disabled |
I'm trying something, I'll tell you if it succeds. |
7081978
to
3c0caec
Compare
Tests are delayed now. We're experiencing env issues and potential race conditions. So far it seems that while maintenance mode is enabled, the call still goes through when running the test on some env, and only sometimes. 1 of 5 test runs on the same env will fail... Suspecting PHP 7 bug with Needs further research... |
Observed so far:
|
After adding this: diff --git a/apps/dav/lib/Connector/Sabre/MaintenancePlugin.php b/apps/dav/lib/Connector/Sabre/MaintenancePlugin.php
index e648dce5e6..bf309b0aa0 100644
--- a/apps/dav/lib/Connector/Sabre/MaintenancePlugin.php
+++ b/apps/dav/lib/Connector/Sabre/MaintenancePlugin.php
@@ -76,6 +76,7 @@ class MaintenancePlugin extends ServerPlugin {
* @return bool
*/
public function checkMaintenanceMode() {
+ \OCP\Util::writeLog('DEBUG', 'maintenance: ' . $this->config->getSystemValue('maintenance', false), \OCP\Util::DEBUG);
if ($this->config->getSystemValue('singleuser', false)) {
throw new ServiceUnavailable('System in single user mode.');
} And run with log level 0, I can see And maintenance mode is enabled # CommandLineContext::maintenanceModeIs()
[Wed May 10 16:24:24 2017] maintenance:
[Wed May 10 16:24:24 2017] 127.0.0.1:51562 [207]: /remote.php/dav/files/admin
When Connecting to dav endpoint as user "admin" # FeatureContext::connectingToDavEndpointAsUser()
Then the HTTP status code should be "503" # FeatureContext::theHTTPStatusCodeShouldBe()
Failed asserting that 207 matches expected '503'. The enabling maintenance mode doesn't seems to work fine. |
Let's not waste more time on this testing issue and get the main fix merged. |
I'll take care of the splitting tomorrow |
3c0caec
to
3cbe4fb
Compare
I've removed the test related commits from this PR, so only the fix remains. The tests were moved to another branch and PR here #27856 |
stable9.1: #27857 |
3cbe4fb
to
b0c7dd4
Compare
rebased... |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description
Enable maintenance mode plugin also for the new DAV endpoint.
Related Issue
Fixes owncloud/client#5738
How Has This Been Tested?
Integration tests.
Local test with a simple PROPFIND with maintenance mode enabled.
Types of changes
Checklist:
Tagged as critical because it causes data loss with "Local" external storage and potentially other system-wide storages.
Needs backport to stable9.1.
@SergioBertolinSG I need your help with behat: the
@AfterScenario
that disables maintenance mode after the test runs too late. So while the tests pass, the other@AfterScenario
code fails because maintenance mode is still active at this point. Any ideas how to change the priority ?@DeepDiver1975 please review the fix