Skip to content

kvm,utils/test,config/test: fix flaky unit tests#11834

Closed
shwstppr wants to merge 1 commit into
apache:mainfrom
shwstppr:fix-unittest-flakiness
Closed

kvm,utils/test,config/test: fix flaky unit tests#11834
shwstppr wants to merge 1 commit into
apache:mainfrom
shwstppr:fix-unittest-flakiness

Conversation

@shwstppr

@shwstppr shwstppr commented Oct 13, 2025

Copy link
Copy Markdown
Contributor

Description

Fixes flakiness in unit test causing packaging failures.
Improves disconnect hook handling for KVM

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

Failures see

14:31:39 [ERROR]   LazyCacheTest.testLoaderNotCalledIfPresent:63 
14:31:39 function.apply("key2");
14:31:39 Wanted 1 time:
14:31:39 -> at org.apache.cloudstack.utils.cache.LazyCacheTest.testLoaderNotCalledIfPresent(LazyCacheTest.java:63)
14:31:39 But was 2 times:
14:31:39 -> at com.github.benmanes.caffeine.cache.LocalLoadingCache.lambda$newMappingFunction$3(LocalLoadingCache.java:183)
14:31:39 -> at com.github.benmanes.caffeine.cache.LocalLoadingCache.lambda$newMappingFunction$3(LocalLoadingCache.java:183)

...

16:51:51 [ERROR] Failures: 
16:51:51 [ERROR]   LazyCacheTest.testMaximumSize:113 
16:51:51 function.apply("key7");
16:51:51 Wanted 2 times:
16:51:51 -> at org.apache.cloudstack.utils.cache.LazyCacheTest.testMaximumSize(LazyCacheTest.java:113)
16:51:51 But was 1 time:
16:51:51 -> at com.github.benmanes.caffeine.cache.LocalLoadingCache.lambda$newMappingFunction$3(LocalLoadingCache.java:183)
16:51:51 
16:51:51 [INFO] 
16:51:51 [ERROR] Tests run: 2696, Failures: 1, Errors: 0, Skipped: 1
10:20:17 [ERROR] Failures: 
10:20:17 [ERROR]   ConfigKeyScheduledExecutionWrapperTest.scheduleDynamicTest:110 Runnable ran four times per second
10:20:17 Expected: one of {<7>, <8>}
10:20:17      but: was <9>
10:20:17 [INFO] 
10:20:17 [ERROR] Tests run: 27, Failures: 1, Errors: 0, Skipped: 0

...

12:55:18 [ERROR] Failures: 
12:55:18 [ERROR]   ConfigKeyScheduledExecutionWrapperTest.scheduleDynamicTest:110 Runnable ran four times per second
12:55:18 Expected: one of {<7>, <8>}
12:55:18      but: was <6>
12:55:18 [INFO] 
12:55:18 [ERROR] Tests run: 27, Failures: 1, Errors: 0, Skipped: 0
17:07:14 [ERROR] Failures: 
17:07:14 [ERROR]   DisconnectHooksTest.addAndRunTwoHooksWithTimeout:166
17:07:14 [INFO] 
17:07:14 [ERROR] Tests run: 576, Failures: 1, Errors: 0, Skipped: 2

How did you try to break this feature and the system with this change?

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@codecov

codecov Bot commented Oct 13, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 39.13043% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.55%. Comparing base (b99a030) to head (a2ea1e1).
⚠️ Report is 437 commits behind head on main.

Files with missing lines Patch % Lines
...ervisor/kvm/resource/LibvirtComputingResource.java 39.13% 14 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #11834      +/-   ##
============================================
- Coverage     17.56%   17.55%   -0.02%     
- Complexity    15500    15524      +24     
============================================
  Files          5899     5907       +8     
  Lines        527793   528671     +878     
  Branches      64479    64558      +79     
============================================
+ Hits          92714    92809      +95     
- Misses       424653   425429     +776     
- Partials      10426    10433       +7     
Flag Coverage Δ
uitests 3.58% <ø> (-0.01%) ⬇️
unittests 18.62% <39.13%> (-0.02%) ⬇️

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:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@shwstppr

shwstppr commented Nov 4, 2025

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@shwstppr a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@DaanHoogland DaanHoogland left a comment

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.

never mind my deleted comment on resetMs, clgtm

@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 15629

@github-actions

github-actions Bot commented Mar 5, 2026

Copy link
Copy Markdown

This PR is stale because it has been open for 120 days with no activity. It may be removed by administrators of this project at any time. Remove the stale label or comment to request for removal of it to prevent this.

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17013

@weizhouapache

Copy link
Copy Markdown
Member

@shwstppr
is this still applicable ?

@shwstppr shwstppr closed this May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants