Skip to content
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

[QA] Flaky API test #8864

Closed
nirajacharya2 opened this issue Apr 16, 2024 · 4 comments · May be fixed by #8891
Closed

[QA] Flaky API test #8864

nirajacharya2 opened this issue Apr 16, 2024 · 4 comments · May be fixed by #8891
Assignees
Labels

Comments

@nirajacharya2
Copy link
Contributor

nirajacharya2 commented Apr 16, 2024

Describe the bug

API tests are failing because AfterScenario after test tests/acceptance/features/apiSharingNg/sharedByMe.feature:1487 is failing which is causing the next test i.e. tests/acceptance/features/apiSharingNg/sharedWithMe.feature:15 to fail

Builds

https://drone.owncloud.com/owncloud/ocis/33717/32/5
https://drone.owncloud.com/owncloud/ocis/33719/32/5
https://drone.owncloud.com/owncloud/ocis/33720/32/5

# previous scenario fail

  @env-config
  Scenario: user lists shared resources for deleted group                                           # /drone/src/tests/acceptance/features/apiSharingNg/sharedByMe.feature:1487
    Given the config "GRAPH_SPACES_GROUPS_CACHE_TTL" has been set to "1"                            # OcisConfigContext::theConfigHasBeenSetTo()
    And group "grp1" has been created                                                               # FeatureContext::groupHasBeenCreated()
    And the administrator has assigned the role "Admin" to user "Alice" using the Graph API         # GraphContext::theAdministratorHasGivenTheRoleUsingTheGraphApi()
    And user "Alice" has uploaded file with content "hello world" to "textfile.txt"                 # FeatureContext::userHasUploadedAFileWithContentTo()
    And user "Alice" has sent the following share invitation:                                       # SharingNgContext::userHasSentTheFollowingShareInvitation()
      | resource        | textfile.txt |
      | space           | Personal     |
      | sharee          | grp1         |
      | shareType       | group        |
      | permissionsRole | Viewer       |
    And group "grp1" has been deleted                                                               # FeatureContext::groupHasBeenDeleted()
    When user "Alice" lists the shares shared by her after clearing group cache using the Graph API # GraphContext::userListsTheResourcesSharedByAUserAfterClearingUserOrGroupSpaceUsingGraphApi()
    Then the HTTP status code should be "200"                                                       # FeatureContext::thenTheHTTPStatusCodeShouldBe()
    And the JSON data of the response should match                                                  # FeatureContext::theJsonDataOfTheResponseShouldMatch()
      """
      {
        "type": "object",
        "required": [
          "value"
        ],
        "properties": {
          "value": {
            "type": "array",
            "minItems":0,
            "maxItems":0
          }
        }
      }
      """
  │
  ╳  HTTP status code 404 is not the expected value 204
  ╳  Failed asserting that 404 matches expected 204.
  │
  └─ @AfterScenario # FeatureContext::afterScenario()

# apiSharingNg/sharedWithMe.feature:15
Scenario: user lists the file shared with them                                        # /drone/src/tests/acceptance/features/apiSharingNg/sharedWithMe.feature:15
    Given user "Alice" has uploaded file with content "hello world" to "/textfile0.txt" # FeatureContext::userHasUploadedAFileWithContentTo()
    And user "Alice" has sent the following share invitation:                           # SharingNgContext::userHasSentTheFollowingShareInvitation()
      | resource        | textfile0.txt |
      | space           | Personal      |
      | sharee          | Brian         |
      | shareType       | user          |
      | permissionsRole | Viewer        |
    When user "Brian" lists the shares shared with him using the Graph API              # GraphContext::userListsTheResourcesSharedWithThemUsingGraphApi()
    Then the HTTP status code should be "200"                                           # FeatureContext::thenTheHTTPStatusCodeShouldBe()
    And the JSON data of the response should match
     Enum failed, enum: [true], data: false at #->properties:value->items[0]:0->properties:@client.synchronize (Swaggest\JsonSchema\Exception\EnumException)

# response
{
  "value": [
    {
      "@UI.Hidden": false,
      "@client.synchronize": false
      ...
    }
  ]
}
@saw-jan
Copy link
Member

saw-jan commented Apr 18, 2024

Temporary fix done in #8868

@saw-jan saw-jan assigned saw-jan and unassigned S-Panta Apr 18, 2024
@saw-jan
Copy link
Member

saw-jan commented Apr 18, 2024


╳ HTTP status code 404 is not the expected value 204
╳ Failed asserting that 404 matches expected 204.

└─ @AfterScenario # FeatureContext::afterScenario()

This error is there everytime on both pass and fail. This probably was not the cause for the failure in next scenario.
AS mentioned in #8859 (comment), race condition might be the case for the failure

@saw-jan
Copy link
Member

saw-jan commented Apr 18, 2024

Failed in other scenarios as well
https://drone.owncloud.com/owncloud/ocis/33884/32/6

Scenario: user lists folder shared with them in a group from sharer's personal space      # /drone/src/tests/acceptance/features/apiSharingNg/sharedWithMe.feature:2498
    Given using spaces DAV path                                                             # FeatureContext::usingOldOrNewDavPath()
    And the administrator has assigned the role "Admin" to user "Alice" using the Graph API # GraphContext::theAdministratorHasGivenTheRoleUsingTheGraphApi()
    And user "Alice" has created folder "folder"                                            # FeatureContext::userHasCreatedFolder()
    And user "Alice" has created a group "grp1" using the Graph API                         # GraphContext::userHasCreatedGroupUsingTheGraphApi()
    And user "Brian" has been added to group "grp1"                                         # FeatureContext::userHasBeenAddedToGroup()
    And user "Alice" has sent the following share invitation:                               # SharingNgContext::userHasSentTheFollowingShareInvitation()
      | resource        | folder   |
      | space           | Personal |
      | sharee          | grp1     |
      | shareType       | group    |
      | permissionsRole | Viewer   |
    When user "Brian" lists the shares shared with him using the Graph API                  # GraphContext::userListsTheResourcesSharedWithThemUsingGraphApi()
    Then the HTTP status code should be "200"                                               # FeatureContext::thenTheHTTPStatusCodeShouldBe()
    And the JSON data of the response should match
Enum failed, enum: [true], data: false at #->properties:value->items[0]:0->properties:@client.synchronize (Swaggest\JsonSchema\Exception\EnumException)

Scenario: user lists the file shared with them from project space                                             # /drone/src/tests/acceptance/features/apiSharingNg/sharedWithMe.feature:3544
    Given using spaces DAV path                                                                                 # FeatureContext::usingOldOrNewDavPath()
    And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API               # GraphContext::theAdministratorHasGivenTheRoleUsingTheGraphApi()
    And user "Alice" has created a space "new-space" with the default quota using the Graph API                 # SpacesContext::theUserHasCreatedASpaceByDefaultUsingTheGraphApi()
    And user "Alice" has uploaded a file inside space "new-space" with content "some content" to "testfile.txt" # SpacesContext::userHasUploadedFile()
    And user "Alice" has sent the following share invitation:                                                   # SharingNgContext::userHasSentTheFollowingShareInvitation()
      | resource        | testfile.txt |
      | space           | new-space    |
      | sharee          | Brian        |
      | shareType       | user         |
      | permissionsRole | Viewer       |
    When user "Brian" lists the shares shared with him using the Graph API                                      # GraphContext::userListsTheResourcesSharedWithThemUsingGraphApi()
    Then the HTTP status code should be "200"                                                                   # FeatureContext::thenTheHTTPStatusCodeShouldBe()
    And the JSON data of the response should match
Const failed at #->properties:value->items[0]:0->properties:@client.synchronize (Swaggest\JsonSchema\Exception\ConstException)

@saw-jan
Copy link
Member

saw-jan commented Apr 25, 2024

Closing in favor of #8859

@saw-jan saw-jan closed this as completed Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants