owncloud / ocis

:atom_symbol: ownCloud Infinite Scale Stack
https://doc.owncloud.com/ocis/next/
Apache License 2.0
1.4k stars 183 forks source link

API tests fail Intermittently on folder creation step #7332

Closed KarunAtreya closed 1 year ago

KarunAtreya commented 1 year ago

While creating folder in test steps, 409 response code is returned Previously this type of intermittent test failure was encountered as in the issue https://github.com/owncloud/ocis/issues/6630 Since this type of failure was not reproducable locally, code for retrying on 409 status code was added in the pr https://github.com/owncloud/ocis/pull/6796

Currently this type of test failure is again encounterd and the response is still 409 after retrying for multiple times.

Build: https://drone.owncloud.com/owncloud/ocis/26826 https://drone.owncloud.com/owncloud/ocis/26786


 Scenario: sharee uploads a chunked file with correct checksum to a received share folder should work                                                                                                               # /drone/src/tests/acceptance/features/apiSpacesShares/shareUploadTUS.feature:248
    Given user "Alice" has created folder "/FOLDER"                                                                                                                                                                  # FeatureContext::userHasCreatedFolder()
      │ ### RESPONSE
      │ Status: 409
      │ Headers:
      │ Access-Control-Allow-Origin: *
      │ Content-Length: 230
      │ Content-Security-Policy: default-src 'none';
      │ Content-Type: text/xml; charset=utf-8
      │ Date: Thu, 21 Sep 2023 11:44:56 GMT
      │ Vary: Origin
      │ X-Content-Type-Options: nosniff
      │ X-Download-Options: noopen
      │ X-Frame-Options: SAMEORIGIN
      │ X-Permitted-Cross-Domain-Policies: none
      │ X-Request-Id: apiSpacesShares/shareUploadTUS.feature:248-249
      │ X-Robots-Tag: none
      │ X-Xss-Protection: 1; mode=block
      │ Body:
      │ string(230) "<?xml version="1.0" encoding="UTF-8"?>
      │ <d:error xmlns:d="DAV" xmlns:s="http://sabredav.org/ns"><s:exception>Sabre\DAV\Exception\Conflict</s:exception><s:message>create container: error: precondition failed: .</s:message></d:error>"
.....................................
......................................
.................................
│ 
      │ ### END RESPONSE
      │ ### RESPONSE
      │ Status: 409
      │ Headers:
      │ Access-Control-Allow-Origin: *
      │ Content-Length: 230
      │ Content-Security-Policy: default-src 'none';
      │ Content-Type: text/xml; charset=utf-8
      │ Date: Thu, 21 Sep 2023 11:45:06 GMT
      │ Vary: Origin
      │ X-Content-Type-Options: nosniff
      │ X-Download-Options: noopen
      │ X-Frame-Options: SAMEORIGIN
      │ X-Permitted-Cross-Domain-Policies: none
      │ X-Request-Id: apiSpacesShares/shareUploadTUS.feature:248-249
      │ X-Robots-Tag: none
      │ X-Xss-Protection: 1; mode=block
      │ Body:
      │ string(230) "<?xml version="1.0" encoding="UTF-8"?>
      │ <d:error xmlns:d="DAV" xmlns:s="http://sabredav.org/ns"><s:exception>Sabre\DAV\Exception\Conflict</s:exception><s:message>create container: error: precondition failed: .</s:message></d:error>"
      │ 
      │ ### END RESPONSE
      │ 
      HTTP status code was not 201 or 204 while trying to create folder '/FOLDER' for user 'Alice'
      Failed asserting that an array contains 409.
    And user "Alice" has shared folder "/FOLDER" with user "Brian" 
KarunAtreya commented 1 year ago

this issue was produced in https://github.com/owncloud/ocis/pull/7298 due to not resetting of WebDavHelper::$SPACE_ID_FROM_OCIS after scenario so the next scenario was using the space id that is not available causing the error. So the variable is set to empty after each api request in https://github.com/owncloud/ocis/pull/7298/commits/bcb366856f946784cfb0ac71976cb6c9c7b35f63 So closing the issue