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

Flaky test at the SonarCloud step due to "no artifacts found" #25334

Closed
andybalaam opened this issue May 11, 2023 · 14 comments · Fixed by matrix-org/matrix-js-sdk#3376
Closed
Assignees
Labels
A-Developer-Experience Z-Flaky-Test A test is raising false alarms

Comments

@andybalaam
Copy link
Member

andybalaam commented May 11, 2023

Sometimes, when we try to kick off the SonarCloud step, the artifacts from the previous workflow are not yet present, and it fails.

Examples of failures caused by this:

@andybalaam andybalaam added A-Developer-Experience Z-Flaky-Test A test is raising false alarms labels May 11, 2023
@andybalaam
Copy link
Member Author

The failing job is .github/workflows/sonarqube.yml, which is kicked when Tests finishes:

on:
    workflow_run:
        workflows: ["Tests"]
        types:
            - completed

@andybalaam
Copy link
Member Author

sonarqube.yml in matrix-react-sdk just kicks off sonarcube.yml in matrix-js-sdk.

@luixxiul
Copy link

Do those PRs, with X-Needs-Percy label, keep failing after being added again until this issue is fixed?

@andybalaam
Copy link
Member Author

Do those PRs, with X-Needs-Percy label, keep failing after being added again until this issue is fixed?

I think this is flaky, so they should pass sometimes.

@t3chguy
Copy link
Member

t3chguy commented May 11, 2023

So Sonar shouldn't be running at all in the example of https://github.com/matrix-org/matrix-react-sdk/actions/runs/4946075148/jobs/8843676973 due to us not caring about covg in the merge queue. We look to be missing a line like https://github.com/matrix-org/matrix-js-sdk/blob/develop/.github/workflows/sonarqube.yml#L39 - maybe we can apply it to https://github.com/matrix-org/matrix-react-sdk/blob/develop/.github/workflows/sonarqube.yml and thus react-sdk runs will respect it too

andybalaam added a commit to matrix-org/matrix-react-sdk that referenced this issue May 11, 2023
We are not interested in coverage information when a PR has already been
approved, and we were seeing flakiness with SonarCloud with the "no
artifacts found" error
element-hq/element-web#25334 .
@andybalaam
Copy link
Member Author

Created matrix-org/matrix-react-sdk#10863 to address @t3chguy 's comment (thanks!). Now looking into whether this is a problem more widely than the merge queue.

@andybalaam
Copy link
Member Author

I can't find any recent examples of this failure outside of the merge queue, so I'm going to close this until I see one. The above-mentioned fix should remove the vast majority of the failures.

github-merge-queue bot pushed a commit to matrix-org/matrix-react-sdk that referenced this issue May 11, 2023
We are not interested in coverage information when a PR has already been
approved, and we were seeing flakiness with SonarCloud with the "no
artifacts found" error
element-hq/element-web#25334 .
andybalaam added a commit to matrix-org/matrix-react-sdk that referenced this issue May 11, 2023
We are not interested in coverage information when a PR has already been
approved, and we were seeing flakiness with SonarCloud with the "no
artifacts found" error
element-hq/element-web#25334 .
@andybalaam
Copy link
Member Author

Here is a non-merge-queue example of this that happened today: https://github.com/matrix-org/matrix-js-sdk/actions/runs/4993512503

Re-opening.

@andybalaam andybalaam reopened this May 16, 2023
@andybalaam
Copy link
Member Author

I re-ran https://github.com/matrix-org/matrix-js-sdk/actions/runs/4993512503 about an hour later, and it failed with the same error. This seems like enough time for any race condition to have fixed itself, and not enough time for artifacts to be cleaned up, but that is just based on my feelings about it, not facts.

@t3chguy
Copy link
Member

t3chguy commented May 16, 2023

@andybalaam the Test job for that one got cancelled - https://github.com/matrix-org/matrix-js-sdk/actions/runs/4993450997

@andybalaam
Copy link
Member Author

@andybalaam the Test job for that one got cancelled - https://github.com/matrix-org/matrix-js-sdk/actions/runs/4993450997

Hmm... so maybe we can prevent the downstream tests from running when it's been cancelled?

@t3chguy
Copy link
Member

t3chguy commented May 16, 2023

Downstream tests don't run unless local tests pass, the run you linked isn't related to downstream testing. The PR I made above will skip js-sdk's sonar prepare stage if the tests job failed. The other layers don't need this as they don't have a similar Prepare stage (js-sdk needs it to merge coverage results)

@andybalaam
Copy link
Member Author

Ah, I thought you meant that the failure was caused by the Test job being cancelled?

@t3chguy
Copy link
Member

t3chguy commented May 16, 2023

It was, but normal tests, not downstream tests. The flow is

Test -> Sonar -> Sonar reusable

in all layers other than js-sdk the Sonar job just calls upon Sonar reusable. js-sdk does a prepare stage, Sonar reusable checks the calling job (Test) was successful, the prepare stage did not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Developer-Experience Z-Flaky-Test A test is raising false alarms
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants