Skip to content

UNOMI-881: Harden GoalsServiceImplTest against CI flakiness#788

Merged
sergehuber merged 1 commit into
masterfrom
UNOMI-881-goals-test-flake
Jun 29, 2026
Merged

UNOMI-881: Harden GoalsServiceImplTest against CI flakiness#788
sergehuber merged 1 commit into
masterfrom
UNOMI-881-goals-test-flake

Conversation

@sergehuber

Copy link
Copy Markdown
Contributor

Summary

  • Fix intermittent CI failure in GoalsServiceImplTest.testSetGoalWithNestedConditions (seen on PR UNOMI-934/935: Return 400 for invalid rule/segment create (Phase 2 PR 4) #787 full ./build.sh --ci run; passed on rerun).
  • Align @AfterEach teardown with RulesServiceImplTest: shut down TestEventAdmin, RulesServiceImpl, scheduler, and detach the rules event listener.
  • Clear ExecutionContextManager thread-local context between tests to avoid tenant leakage across the Surefire JVM.
  • Run nested-condition setGoal under executeAsSystem() so system-tenant condition types resolve reliably; add assertNotNull guards and explicit goal.setItemId.

Context

Unrelated to REST exception mapping (#787). Test-only change; no production code.

Test plan

  • mvn -pl services test -Dmaven.build.cache.enabled=false -Dtest=GoalsServiceImplTest
  • Full CI ./build.sh --ci (unit tests)

Align teardown with RulesServiceImplTest (shutdown event admin, rules service, scheduler), clear execution context between tests, and run nested-condition setup under executeAsSystem so system-tenant condition types resolve reliably in CI.
@sergehuber sergehuber force-pushed the UNOMI-881-goals-test-flake branch from ccc7bf1 to 88d05bf Compare June 29, 2026 09:53
@sergehuber sergehuber merged commit 5ebbe8a into master Jun 29, 2026
5 of 6 checks passed
@sergehuber sergehuber deleted the UNOMI-881-goals-test-flake branch June 29, 2026 11:03
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