[
https://issues.apache.org/jira/browse/NIFI-16353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18121149#comment-18121149
]
ASF subversion and git services commented on NIFI-16353:
--------------------------------------------------------
Commit 856f2f4698e00ba25fa58e0e8343d628b9ae7a35 in nifi's branch
refs/heads/main from skeossei
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=856f2f4698e ]
NIFI-16353 - Isolate StandardConnectorTestRunner filesystem paths (#11686)
* NIFI-16353 Isolate StandardConnectorTestRunner filesystem paths
* NIFI-16353 Address review feedback for ConnectorTestRunner isolation
Use File for instance directories, drop mirrored property-mapping tests, and
assert isolation sequentially.
Co-authored-by: Cursor <[email protected]>
---------
Co-authored-by: Cursor <[email protected]>
> Support filesystem isolation for StandardConnectorTestRunner instances
> ----------------------------------------------------------------------
>
> Key: NIFI-16353
> URL: https://issues.apache.org/jira/browse/NIFI-16353
> Project: Apache NiFi
> Issue Type: Improvement
> Components: Core Framework
> Reporter: Sevag Keosseian
> Assignee: Sevag Keosseian
> Priority: Minor
> Labels: Connector, test-infrastructure
> Time Spent: 2h
> Remaining Estimate: 0h
>
> StandardConnectorTestRunner uses shared mutable directories under
> target/work, while its NiFi properties use shared repository and storage
> paths under target/nifi-storage.
> When multiple runners execute concurrently, they create separate mock NiFi
> instances but can write to the same:
> - FlowFile, content, database, and NAR repositories
> - WAL and state files
> - Assets and connector assets
> - Unpacked NAR working directories
> - Jetty working directories
> This can cause cross-writes, repository corruption, startup failures, or one
> runner’s shutdown affecting another runner.
> NIFI-16183 increased the graceful shutdown timeout, which widened the
> collision window but did not cause the underlying shared-filesystem problem.
> Its shutdown behavior should remain unchanged.
> Proposed behavior
> Add an optional API:
> {code:java}
> StandardConnectorTestRunner.Builder.instanceDirectory(File){code}
> When supplied, all mutable NiFi paths must be derived from that instance
> root. The configured NAR library directory remains shared and read-only.
> When no instance directory is supplied, preserve the existing directory
> behavior for backward compatibility.
> Continue using OS-assigned HTTP ports by default.
> Caller-provided instance directories remain caller-owned and must not be
> deleted when the runner closes or bootstrap fails.
> Acceptance criteria
> - Separate instance roots isolate all mutable paths.
> - The NAR library directory remains shared.
> - Two runners can start and stop concurrently without cross-writing.
> - Closing one runner does not affect the other.
> - Caller-provided directories are retained after shutdown and bootstrap
> failure.
> - Existing builder APIs remain compatible.
> - Default port selection remains OS-assigned.
> - Existing behavior is preserved when instanceDirectory is omitted.
> - NIFI-16183 shutdown timeout behavior is unchanged.
> Verification
> {code:java}
> ./mvnw \
> -pl
> nifi-connector-mock-bundle/nifi-connector-mock-test-bundle/nifi-connector-mock-integration-tests
> \
> -am clean verify \
> -DforkCount=2 \
> -DreuseForks=true{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)