Skip to content
This repository was archived by the owner on Nov 23, 2026. It is now read-only.

[tests-only][full-ci]Fix flaky versions test - #5883

Closed
SwikritiT wants to merge 1 commit into
masterfrom
flaky-files-versions-test-fix
Closed

SwikritiT wants to merge 1 commit into
masterfrom
flaky-files-versions-test-fix

Conversation

@SwikritiT

@SwikritiT SwikritiT commented Oct 7, 2021 •

Copy link
Copy Markdown
Contributor

Description

This PR adds a fix for failing versions tests and also updates the hook for setting screenshots for tests.

Related Issue

Motivation and Context

webUIFilesActionMenu/versions.feature:36 was flaky and was passing on retry a lot and sometimes even failing. The behavior could only be reproduced in CI as it passed without any problem locally, even if it's run multiple times. It failed on the And the versions list should contain 2 entries step because it couldn't find the second version. Upon inspecting the screenshots the second version wasn't created probably because the file wasn't uploaded as this scenario requires few put operations for updating the versions. Upon adding a pause before put operation and increasing the waitTime which will eventually give enough time for the file to be uploaded, the tests pass.

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

Open tasks:

  • ...

@sonarqubecloud

sonarqubecloud Bot commented Oct 7, 2021

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

await pollCheck()

const davPath = exports.createDavPath(user, fileName)
await client.pause(1000)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

explicit pause can lead to a longer test run time cumulatively. Any other solutions?

@SwikritiT SwikritiT Oct 8, 2021 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None that I can think of. The version of the file is not created because the file doesn't get uploaded in a short time. Do you have any suggestions?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding some context why that pause was necessary will be so helpful.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SwikritiT file gets uploaded correctly. If it wasn't uploaded then the tests should fail in step Then the content of file ....
File gets uploaded and the content is also updated to the last one but web shows only one version of it. It is so weird.

const filename = testCase.pickle.uri
.replace('tests/acceptance/features/', '')
.replace('/', '-')
.replace('.', '-')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See if we can still get those line numbers, otherwise, screenshots with multiple failures in the same feature file will be confusing

)

await client.pause(500)
await client.pause(1000)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

increasing pause time here will work. above changes are not required.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@saw-jan saw-jan Oct 8, 2021 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, failed on multiple runs. I only tried with some scenarios.
But keep it wisely so that there won't be unnecessary longer waits.

@fschade

fschade commented Oct 9, 2021 •

Copy link
Copy Markdown
Contributor

i get the point that we have to use some timeouts here and there, but this can lead to flaky tests if network is slower or in other cases. Instead of timeout, can't we just wait for the file to be visible in the ui?

Then we can be sure that the upload is finished. Just thinking loud, open for other solutions as well.

@pascalwengerter

Copy link
Copy Markdown
Contributor

@individual-it @kulmann

This is a really nasty one. I tried investigating it now and even when waiting for a full 5-10 seconds plus reloading the page (and even when doing both twice in a row) there's no guarantee the backend won't just send one version (instead of the expected two versions). Not sure how to proceed now, these tests do have a negative impact on our productivity at the moment (as in a minimum of 50% of our CI runs fail because of flaky version tests)

@kulmann

kulmann commented Oct 13, 2021

Copy link
Copy Markdown
Contributor

@individual-it @kulmann

This is a really nasty one. I tried investigating it now and even when waiting for a full 5-10 seconds plus reloading the page (and even when doing both twice in a row) there's no guarantee the backend won't just send one version (instead of the expected two versions). Not sure how to proceed now, these tests do have a negative impact on our productivity at the moment (as in a minimum of 50% of our CI runs fail because of flaky version tests)

I'd say we skip the test in CI entirely. If there is the wish/need to get it fixed, the skip label can be removed in this PR after a rebase. Ok?

@pascalwengerter

Copy link
Copy Markdown
Contributor

@individual-it @kulmann
This is a really nasty one. I tried investigating it now and even when waiting for a full 5-10 seconds plus reloading the page (and even when doing both twice in a row) there's no guarantee the backend won't just send one version (instead of the expected two versions). Not sure how to proceed now, these tests do have a negative impact on our productivity at the moment (as in a minimum of 50% of our CI runs fail because of flaky version tests)

I'd say we skip the test in CI entirely. If there is the wish/need to get it fixed, the skip label can be removed in this PR after a rebase. Ok?

Done in 88b7172, closing this PR in favor of the other commit/PR. Thanks JankariTech for investigating!

@phil-davis

Copy link
Copy Markdown
Contributor

If I am reading correctly, in this case the back-end is unreliable and does not consistently provide either the expected result, or a failing result.
If/when we have that situation, we know that the result will be "random" and so there is no way to predict and expect something. Removing the test from CI what has to be done to get CI reliable again. But fixing the back-end problem would be even better.

Note: if this is a file versions thing, then is there some relation to the 1-second granularity of versions? I know that we have had trouble in the past because actually if you update a file twice in the same second, then you only end up with one effective version created. I thought that we had put suitable delays in creating/updating files in tests so that this known problem should not happen.

@kulmann

kulmann commented Oct 14, 2021

Copy link
Copy Markdown
Contributor

I'd be happy to get the test back once it's stable. @phil-davis can you guys continue investigating? A PR that removes the skip label again would be the ideal outcome. I cannot tell where the instability originates from.

@individual-it

Copy link
Copy Markdown
Member

@phil-davis if this in an backend bug and not only a limitation because versions are only saved once a second, there should be some API tests failing

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

versions tests sometimes fail with too little versions listed

8 participants