Skip to content

test: use /test for TestGiteaReTestAll (and rename it)#2589

Open
chmouel wants to merge 3 commits intotektoncd:mainfrom
chmouel:fix-gitlab-retest-all-flawed-test
Open

test: use /test for TestGiteaReTestAll (and rename it)#2589
chmouel wants to merge 3 commits intotektoncd:mainfrom
chmouel:fix-gitlab-retest-all-flawed-test

Conversation

@chmouel
Copy link
Member

@chmouel chmouel commented Mar 18, 2026

📝 Description of the Change

The TestGiteaRetestAll E2E test was flaky due to a race condition
between the initial pull_request event and the /retest comment event.

Here is what was happening:

  1. The test creates a PR, which triggers a PipelineRun
  2. The test then posts /retest to re-run all pipelines
  3. Both events (pull_request and retest) are processed concurrently
  4. The /retest handler calls filterSuccessfulTemplates to skip
    pipelines that already succeeded
  5. Because the initial PipelineRun completes very fast (it just runs
    "echo HELLOMOTO"), the retest filter sometimes sees it as already
    successful and skips it
  6. This means only 1 out of 2 expected statuses are created, causing
    a timeout

The fix is to use /test instead of /retest. The /test command
re-runs all pipelines unconditionally, without checking if they
already succeeded. This eliminates the race condition entirely.

The test is also renamed from TestGiteaRetestAll to TestGiteaTestAll
to reflect the new behavior being tested, and a stale TODO comment
is removed.

🔗 Linked GitHub Issue

Fixes #

🧪 Testing Strategy

  • Unit tests
  • Integration tests
  • End-to-end tests
  • Manual testing
  • Not Applicable

🤖 AI Assistance

AI assistance can be used for various tasks, such as code generation,
documentation, or testing.

Please indicate whether you have used AI assistance
for this PR and provide details if applicable.

  • I have not used any AI assistance for this PR.
  • I have used AI assistance for this PR.

Important

Slop will be simply rejected, if you are using AI assistance you need to make sure you
understand the code generated and that it meets the project's standards. you
need at least know how to run the code and deploy it (if needed). See
startpaac to make it easy
to deploy and test your code changes.

If the majority of the code in this PR was generated by an AI, please add a Co-authored-by trailer to your commit message.
For example:

Co-authored-by: Claude noreply@anthropic.com

✅ Submitter Checklist

  • 📝 My commit messages are clear, informative, and follow the project's How to write a git commit message guide. The Gitlint linter ensures in CI it's properly validated
  • ✨ I have ensured my commit message prefix (e.g., fix:, feat:) matches the "Type of Change" I selected above.
  • ♽ I have run make test and make lint locally to check for and fix any
    issues. For an efficient workflow, I have considered installing
    pre-commit and running pre-commit install to
    automate these checks.
  • 📖 I have added or updated documentation for any user-facing changes.
  • 🧪 I have added sufficient unit tests for my code changes.
  • 🎁 I have added end-to-end tests where feasible. See README for more details.
  • 🔎 I have addressed any CI test flakiness or provided a clear reason to bypass it.
  • If adding a provider feature, I have filled in the following and updated the provider documentation:
    • GitHub App
    • GitHub Webhook
    • Gitea/Forgejo
    • GitLab
    • Bitbucket Cloud
    • Bitbucket Data Center

chmouel and others added 3 commits March 18, 2026 16:50
The TestGiteaRetestAll E2E test was flaky due to a race condition
between the initial pull_request event and the /retest comment event.

Here is what was happening:

1. The test creates a PR, which triggers a PipelineRun
2. The test then posts /retest to re-run all pipelines
3. Both events (pull_request and retest) are processed concurrently
4. The /retest handler calls filterSuccessfulTemplates to skip
   pipelines that already succeeded
5. Because the initial PipelineRun completes very fast (it just runs
   "echo HELLOMOTO"), the retest filter sometimes sees it as already
   successful and skips it
6. This means only 1 out of 2 expected statuses are created, causing
   a timeout

The fix is to use /test instead of /retest. The /test command
re-runs all pipelines unconditionally, without checking if they
already succeeded. This eliminates the race condition entirely.

The test is also renamed from TestGiteaRetestAll to TestGiteaTestAll
to reflect the new behavior being tested, and a stale TODO comment
is removed.

Signed-off-by: Chmouel Boudjnah <chmouel@chmouel.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>
@chmouel
Copy link
Member Author

chmouel commented Mar 19, 2026

/retest

@chmouel chmouel changed the title test: use /test TestGiteaReTestAll (and rename it) test: use /test for TestGiteaReTestAll (and rename it) Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant