-
Notifications
You must be signed in to change notification settings - Fork 196
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
Local API test apiSpaces/changeSpaces.feature:221 fails because there is no cleanup after each test #4390
Comments
#4325 creating quota issue has been fixed and working but seems that the tests is failing locally on The above nightly failure seems to be a flaky pass and cannot be reproduce locally. @SwikritiT since you are working on the quota feature. can you also check the above step and create a new issue for it. Note: Regarding the flaky pass, lets wait up and see on tomorrows nightly. |
It's weird after setting the quota and uploading a file bigger than the set quota |
Upon running the following test it gives Feature: sharing
Background: # /home/swikriti/www/ocis/tests/acceptance/features/apiSpaces/shareOperations.feature:4
Given using OCS API version "1" # FeatureContext::usingOcsApiVersion()
And these users have been created with default attributes and without skeleton files: # FeatureContext::theseUsersHaveBeenCreatedWithDefaultAttributesAndWithoutSkeletonFiles()
| username |
| Alice |
| Brian |
And using spaces DAV path # FeatureContext::usingOldOrNewDavPath()
Scenario: Uploading a file to a group shared folder with upload-only permission when the sharer has insufficient quota does not work # /home/swikriti/www/ocis/tests/acceptance/features/apiSpaces/shareOperations.feature:360
Given group "grp1" has been created # FeatureContext::groupHasBeenCreated()
And user "Brian" has been added to group "grp1" # FeatureContext::userHasBeenAddedToGroup()
And user "Alice" has created folder "FOLDER" # FeatureContext::userHasCreatedFolder()
And user "Alice" has created a share with settings # FeatureContext::userHasCreatedAShareWithSettings()
| path | FOLDER |
| shareType | group |
| permissions | create |
| shareWith | grp1 |
And user "Brian" has accepted share "/FOLDER" offered by user "Alice" # FeatureContext::userHasReactedToShareOfferedBy()
And user "Admin" has changed the quota of the "Alice Hansen" space to "1" #
When user "Brian" uploads a file inside space "Shares Jail" with content "new description" to "/FOLDER/textfile.txt" using the WebDAV API # SpacesContext::theUserUploadsAFileToSpace()
Then the HTTP status code should be "507" # FeatureContext::thenTheHTTPStatusCodeShouldBe()
HTTP status code 201 is not the expected value 507
Failed asserting that 201 matches expected '507'.
And as "Alice" file "/FOLDER/textfile.txt" should not exist OCIS LOG:
When I try to reproduce this through curl, it gives me I think there's some issue while setting the quota. Maybe it's not updated properly. |
Note: PR #4369 removed 3 of 4 examples from expected-failures:
And it left @micbar any thoughts? Maybe something in cs3org/reva#3133 has some flakiness? |
I'm running the server through docker. When I clean start docker container and run the above test for the first two times the tests passes with ocis_1 | 2022/08/15 11:25:30 not registered: events.ShareCreated
ocis_1 | 2022-08-15T11:25:30Z ERR unary code=Unauthenticated end="15/Aug/2022:11:25:30 +0000" from=tcp://127.0.0.1:45130 pkg=rgrpc service=groups start="15/Aug/2022:11:25:30 +0000" time_ns=1871 traceid=00000000000000000000000000000000 uri=/cs3.identity.group.v1beta1.GroupAPI/GetGroup user-agent=grpc-go/1.48.0
ocis_1 | 2022-08-15T11:25:30Z ERR unary code=Unknown end="15/Aug/2022:11:25:30 +0000" from=tcp://127.0.0.1:58410 pkg=rgrpc service=gateway start="15/Aug/2022:11:25:30 +0000" time_ns=210780 traceid=00000000000000000000000000000000 uri=/cs3.gateway.v1beta1.GatewayAPI/GetGroup user-agent=grpc-go/1.48.0
ocis_1 | 2022-08-15T11:25:30Z ERR failed to send a message error="rpc error: code = Unknown desc = gateway: error calling GetGroup: rpc error: code = Unauthenticated desc = auth: core access token not found" event=ShareCreated service=notifications
ocis_1 | 2022/08/15 11:25:31 not registered: events.ReceivedShareUpdated
ocis_1 | 2022/08/15 11:25:31 not registered: events.ReceivedShareUpdated
ocis_1 | 2022-08-15T11:25:31Z ERR failed to initiate upload error="error: insufficient storage: quota exceeded" pkg=rgrpc service=storage-users status={"code":19,"message":"insufficient storage","trace":"00000000000000000000000000000000"} traceid=00000000000000000000000000000000
ocis_1 | 2022/08/15 11:25:31 not registered: events.UserDeleted
ocis_1 | 2022/08/15 11:25:31 not registered: events.UserDeleted But from the 3rd time it starts failing and gives ocis_1 | 2022/08/15 11:25:53 not registered: events.ShareCreated
ocis_1 | 2022-08-15T11:25:53Z ERR unary code=Unauthenticated end="15/Aug/2022:11:25:53 +0000" from=tcp://127.0.0.1:45130 pkg=rgrpc service=groups start="15/Aug/2022:11:25:53 +0000" time_ns=1978 traceid=00000000000000000000000000000000 uri=/cs3.identity.group.v1beta1.GroupAPI/GetGroup user-agent=grpc-go/1.48.0
ocis_1 | 2022-08-15T11:25:53Z ERR unary code=Unknown end="15/Aug/2022:11:25:53 +0000" from=tcp://127.0.0.1:58410 pkg=rgrpc service=gateway start="15/Aug/2022:11:25:53 +0000" time_ns=255520 traceid=00000000000000000000000000000000 uri=/cs3.gateway.v1beta1.GatewayAPI/GetGroup user-agent=grpc-go/1.48.0
ocis_1 | 2022-08-15T11:25:53Z ERR failed to send a message error="rpc error: code = Unknown desc = gateway: error calling GetGroup: rpc error: code = Unauthenticated desc = auth: core access token not found" event=ShareCreated service=notifications
ocis_1 | 2022/08/15 11:25:53 not registered: events.ReceivedShareUpdated
ocis_1 | 2022/08/15 11:25:53 not registered: events.ReceivedShareUpdated
ocis_1 | 2022/08/15 11:25:54 not registered: events.FileUploaded
ocis_1 | 2022/08/15 11:25:54 not registered: events.UserDeleted
ocis_1 | 2022/08/15 11:25:54 not registered: events.UserDeleted The file gets uploaded |
The behavior is the same if I serve ocis locally from repo |
The problem seems to be with the test. As spaces aren't cleared after the user is deleted the test is somehow getting the space id of the previously created user with the same name and setting the quota of that |
step so second steps will be work correct after fixing: #4196 and uncommenting https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/bootstrap/SpacesContext.php#L430-L431 |
That's true so what do we do for now, find a workaround or put the tests in expected to fail? The test does pass locally for me on the first run but from the second run there are a |
The tests in this PR are also failing because of the same reason #4371 |
I suggest we wait for #4196 |
yes, if that is implemented "soon". Otherwise, the tests could remember each space that has been created, and who is the "manager" of that space (usually the user that created it, but there could be a few tests that "handover" the management of a space to another user during the test scenario. Then, before deleting users, the after-scenario can loop through and delete each space, using the authentication of the user who is the "manager" of that space. IMO that algorithm should work, not be difficult to implement, and will continue to work in the future anyway. |
@phil-davis I can suggest this solution: #4433 |
PR #4433 cleans up the user personal spaces in AfterScenario. So that is a good start. Is there some way that we can delete project spaces that were created during a scenario? |
Someone that's granted with the
This deletes
We just can find out who the manager is of the created space, and then send a request from that user to delete the space in the after scenario. Could be a workaround until the admin has the permission to do so? |
deleting the project space is nice to have, but it does not block any tests. here we can definitely wait #4196 IMHO or implement deleting project space:
should we wait or implement deleting project space? What do you think? |
deleting spaces increased run time in CI - 28 min. https://drone.owncloud.com/owncloud/ocis/14804/41/7 we should probably parallelize the tests |
Yes, agree. There are 342 scenarios - so it is good that so many run in less than 30 minutes! A few other pipelines are taking 20 to 25 minutes. But that is a separate thing to look at. Is there some sensible way to name 2 Or do we just name them |
The code to delete project spaces should be "easy" - why not just do it now? |
part 2 #4441 |
Test:
apiSpaces/changeSpaces.feature:221
Drone job: https://drone.owncloud.com/owncloud/ocis/14430/40/7
Expected behavior: test
apiSpaces/changeSpaces.feature:221
passes in CI each runningThe reason why it doesn't work: no cleaning after each test and admin has a lot of Brians
Test Log:
Drone log:
runsh: Total unexpected passed scenarios throughout the test run: apiSpaces/changeSpaces.feature:221
The text was updated successfully, but these errors were encountered: