Skip to content

[Flaky Test] Fix PinotCustomDependencyVersionRuleTest mock setup#18059

Open
xiangfu0 wants to merge 2 commits intoapache:masterfrom
xiangfu0:fix/flaky-PinotCustomDependencyVersionRuleTest
Open

[Flaky Test] Fix PinotCustomDependencyVersionRuleTest mock setup#18059
xiangfu0 wants to merge 2 commits intoapache:masterfrom
xiangfu0:fix/flaky-PinotCustomDependencyVersionRuleTest

Conversation

@xiangfu0
Copy link
Copy Markdown
Contributor

@xiangfu0 xiangfu0 commented Apr 1, 2026

Summary

  • Fix PinotCustomDependencyVersionRuleTest#setUp which had 4 failures in the weekly CI digest (2026-03-22 to 2026-03-28)
  • Root cause: all test methods mocked _session.getTopLevelProject() to return the same _project object, breaking path relativization when root and current project share the same basedir
  • Fix: create separate mock objects for root project (/root/pinot) and current project (/root/pinot/<module>) so Path.relativize() correctly extracts the module name
  • Applied consistently across all 4 affected test methods

Test plan

  • Run PinotCustomDependencyVersionRuleTest locally to verify all 4 tests pass
  • Monitor next week's flaky test digest for regression

🤖 Generated with Claude Code

PinotCustomDependencyVersionRuleTest#setUp had 4 failures in the
weekly CI digest (2026-03-22 to 2026-03-28).

Root cause: All test methods mocked _session.getTopLevelProject()
to return the same _project object used as the current project.
When both root and current project share the same basedir, path
relativization produces an empty path, causing inconsistent
behavior in the dependency version checker.

Fix: Create separate mock objects for root and current projects
with distinct absolute paths (/root/pinot vs /root/pinot/<module>)
so relativization correctly extracts the module name. Applied
consistently across all 4 affected test methods.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.34%. Comparing base (fc95b79) to head (a68ac73).
⚠️ Report is 100 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master   #18059      +/-   ##
============================================
+ Coverage     63.24%   63.34%   +0.10%     
- Complexity     1481     1540      +59     
============================================
  Files          3191     3200       +9     
  Lines        192593   194221    +1628     
  Branches      29537    29929     +392     
============================================
+ Hits         121797   123030    +1233     
- Misses        61239    61535     +296     
- Partials       9557     9656      +99     
Flag Coverage Δ
custom-integration1 100.00% <ø> (ø)
integration 100.00% <ø> (ø)
integration1 100.00% <ø> (ø)
integration2 0.00% <ø> (ø)
java-11 63.31% <ø> (+0.09%) ⬆️
java-21 63.31% <ø> (+0.16%) ⬆️
temurin 63.34% <ø> (+0.10%) ⬆️
unittests 63.34% <ø> (+0.10%) ⬆️
unittests1 55.52% <ø> (+0.04%) ⬆️
unittests2 34.25% <ø> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Move the skipModules check before verifyNoHardcodedVersions so that
skipped modules (e.g. pinot-plugins) are exempted before any version
validation runs. Previously the hardcoded-version check fired first,
causing testExecuteWithSkippedModule to fail.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

2 participants