Skip to content

test(sponsors): make sponsor material types deterministic in fixture - #628

Merged
smarcet merged 1 commit into
mainfrom
fix/flaky-sponsor-material-fixture
Oct 10, 2026
Merged

smarcet merged 1 commit into
mainfrom
fix/flaky-sponsor-material-fixture

Conversation

@smarcet

@smarcet smarcet commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

InsertSummitTestData assigned each of a sponsor's 10 materials a random type (Link/Video/Slide). With probability (2/3)^10 ≈ 1.7% a sponsor gets no Video, so OAuth2SummitSponsorApiTest::testGetAllSponsorsMaterialsBySponsorAndType (filter=type==Video) fails with an empty data array (seen in the OAuth2Tests job of run 37985993376).

The type is now ValidTypes[$j % count(ValidTypes)], so every sponsor always has Video materials.

Tests

vendor/bin/phpunit tests/oauth2/OAuth2SummitSponsorApiTest.php --filter Material → OK (6 tests, 30 assertions).

Random types left ~1.7% of sponsors with no Video material, making
testGetAllSponsorsMaterialsBySponsorAndType flaky in CI.
@coderabbitai

coderabbitai Bot commented Oct 10, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 40 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c15e82da-5b05-497c-849d-6b5100df62c1

📥 Commits

Reviewing files that changed from the base of the PR and between f328955 and bb25eaf.


📒 Files selected for processing (1)
  • tests/InsertSummitTestData.php

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

📘 OpenAPI / Swagger preview

➡️ https://OpenStackweb.github.io/summit-api/openapi/pr-628/

This page is automatically updated on each push to this PR.

@smarcet
smarcet merged commit 28bcacf into main Oct 10, 2026
39 checks passed
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