Skip to content

NIFI-16339 Stabilize race conditions in scheduler and Python NAR reupload tests - #11673

Open
abij wants to merge 1 commit into
apache:mainfrom
abij:NIFI-16339
Open

abij wants to merge 1 commit into
apache:mainfrom
abij:NIFI-16339

Conversation

@abij

@abij abij commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Summary

NIFI-16339

Two unit/system tests contain timing-sensitive race conditions that intermittently fail CI on unrelated pull requests, forcing maintainers to re-run jobs. This PR makes both tests tolerant of valid asynchronous state transitions without changing any production behavior.

TestStandardProcessScheduler.validateNeverEnablingServiceCanStillBeDisabled

disableControllerService(...) is asynchronous. When disabling a controller service whose @OnEnabled is still blocked, the node may already have reached DISABLED by the time the test inspects the state, rather than being observed in the intermediate DISABLING state. Both are valid outcomes, so the strict equality assertion is timing-dependent and fails on fast/loaded runners (observed on Windows Zulu JDK 21):

TestStandardProcessScheduler.validateNeverEnablingServiceCanStillBeDisabled:508
expected: <DISABLING> but was: <DISABLED>

The assertion now accepts either DISABLING or DISABLED.

PythonNarDeletionDuringInitIT.testNarReuploadAfterForceDeleteDuringInit

After a re-uploaded NAR reaches INSTALLED, processor-type discovery can lag briefly, so a single immediate lookup can return null and fail assertNotNull. The test now polls for the processor type (200 ms interval, 30 s monotonic deadline) before asserting.

Out of scope

Several clustered/system tests intermittently hit their 5-minute @Timeout during node startup on CI (worst on ubuntu-24.04 Java 25). The failing test rotates run-to-run (e.g. AutoResumeStateClusteredIT, OffloadContentClaimTruncationIT, FlowSynchronizationIT, ClusteredConnectorTroubleshootingIT, ControllerServiceStateIT). Because there is no single root cause in test logic (only shared timeout pressure), these are tracked separately as CI/runner performance flakiness and are not addressed here.

Tracking

Issue Tracking

Pull Request Tracking

  • Pull Request title starts with Apache NiFi Jira issue number, such as NIFI-00000
  • Pull Request commit message starts with Apache NiFi Jira issue number, as such NIFI-00000

Pull Request Formatting

  • Pull Request based on current revision of the main branch
  • Pull Request refers to a feature branch with one commit containing changes

Verification

Please indicate the verification steps performed prior to pull request creation.

Build

  • Build completed using ./mvnw clean install -P contrib-check
    • JDK 21
    • JDK 25

Licensing

Documentation

  • Documentation not required — test-only change

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