NIFI-16183 Add active-polling stopConnector(Duration) to connector mock framework - #11528
Open
wkochman wants to merge 1 commit into
Open
NIFI-16183 Add active-polling stopConnector(Duration) to connector mock framework#11528wkochman wants to merge 1 commit into
wkochman wants to merge 1 commit into
Conversation
wkochman
force-pushed
the
connector-mock-configurable-stop-timeout
branch
3 times, most recently
from
August 11, 2026 12:41
fcc2389 to
f6bea27
Compare
wkochman
marked this pull request as ready for review
August 11, 2026 12:43
wkochman
force-pushed
the
connector-mock-configurable-stop-timeout
branch
2 times, most recently
from
August 11, 2026 14:52
aebfc70 to
667189f
Compare
markap14
reviewed
Aug 11, 2026
| * default stop budget. | ||
| * | ||
| * @param timeout the maximum duration to wait for the Connector to stop | ||
| * @throws RuntimeException if the timeout elapses before the Connector stops |
Contributor
There was a problem hiding this comment.
An explicit timeout should probably result in a {{java.util.concurrent.TimeoutException}}, rather than a RuntimeException, no?
Author
There was a problem hiding this comment.
make sense, I have changed it on the new method
…ck framework The mock server previously stopped a Connector with a single fixed 10-second blocking wait, which could time out on slower shutdown paths (for example a failed table still draining) even though the Connector node retries its stop internally and eventually reaches STOPPED. - ConnectorTestRunner: add a default stopConnector(Duration) overload - StandardConnectorMockServer: poll the Connector state until STOPPED within the given timeout instead of a single fixed wait - StandardConnectorTestRunner: pass the timeout through to the mock server - CreateConnectorIT: exercise the new overload end-to-end
wkochman
force-pushed
the
connector-mock-configurable-stop-timeout
branch
from
August 11, 2026 20:03
667189f to
e1c8472
Compare
Author
|
The The failure is in The backing Couchbase Testcontainer never came up: So |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Tracked by NIFI-16183.
The connector mock server previously stopped a Connector with a single fixed 10-second blocking wait (
connectorNode.stop(flowEngine).get(10, TimeUnit.SECONDS)). On slower shutdown paths (for example, a failed table still draining) that wait can expire even though the Connector node retries its stop internally and eventually reachesSTOPPED, so an otherwise-passing test fails during teardown with aTimeoutException.This change adds a timeout-aware, active-polling stop to the connector mock framework:
ConnectorTestRunner: adds adefault void stopConnector(Duration timeout)overload that delegates to the no-arg method, keeping it backward compatible for existing implementors.StandardConnectorMockServer: initiates the asynchronous stop and then polls the Connector state until it reportsSTOPPEDwithin the supplied timeout, instead of a single fixed blocking wait. The node flips its state toSTOPPEDat the same point it completes the stop future and retries a failed component stop internally, so polling rides through those retries up to the timeout. Defaults: 60-second budget, 250 ms poll interval; a healthy stop still returns immediately.StandardConnectorTestRunner: passes the timeout through to the mock server.CreateConnectorIT: adds an integration test that exercises the new overload end-to-end against the realGenerateAndLogconnector.Tracking
Issue Tracking
Pull Request Tracking
NIFI-00000NIFI-00000VerifiedstatusPull Request Formatting
mainbranchVerification
Please indicate the verification steps performed prior to pull request creation.
Build
./mvnw clean install -P contrib-checkNote:
contrib-checkwas run on JDK 21 (Temurin 21.0.5), scoped to the affected connector-mock bundle reactor (./mvnw -f nifi-connector-mock-bundle/pom.xml clean install -P contrib-check, all 9 modules). Checkstyle (0 violations), apache-rat, PMD, and the enforcer rules all pass; external dependencies were resolved from the local repository. The new integration test was run separately via theintegration-testsprofile:Tests run: 1, Failures: 0, Errors: 0, Skipped: 0forCreateConnectorIT#testStopConnectorWithTimeoutStopsRunningConnector. A full-repocontrib-checkand a JDK 25 build have not been run.Licensing
LICENSEandNOTICEfiles (no new dependencies are introduced)Documentation