Skip to content

NIFI-16104 Fix flaky ConnectorAssetsIT by polling for asset removal#11420

Open
pvillard31 wants to merge 1 commit into
apache:mainfrom
pvillard31:fix/connector-assets-flaky-test
Open

NIFI-16104 Fix flaky ConnectorAssetsIT by polling for asset removal#11420
pvillard31 wants to merge 1 commit into
apache:mainfrom
pvillard31:fix/connector-assets-flaky-test

Conversation

@pvillard31

Copy link
Copy Markdown
Contributor

Summary

ConnectorAssetsIT.testCreateConnectorAndUploadAsset intermittently fails with:

ConnectorAssetsIT.testCreateConnectorAndUploadAsset:199 expected: <false> but was: <true>

The test asserts that an unreferenced asset is removed immediately after waitForConnectorState(STOPPED). Asset cleanup is asynchronous and may not have completed by the time the connector reaches STOPPED state, making the single-shot assertion inherently racy.

Changes

  • NiFiClientUtil — add waitForAssetRemoved(connectorId, assetId) utility that polls every 100 ms (matching the waitForConnectorState pattern) until the specified asset is absent from the connector's asset list.
  • ConnectorAssetsIT — replace the immediate one-shot getAssets / assertFalse check with a call to waitForAssetRemoved, tolerating the async cleanup delay.

Tracking

Issue Tracking

Pull Request Tracking

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

Testing

  • Existing testCreateConnectorAndUploadAsset now reliably passes because it waits for the async asset cleanup instead of checking exactly once.

@pvillard31
pvillard31 force-pushed the fix/connector-assets-flaky-test branch from 608696d to 005a8c6 Compare July 11, 2026 06:49
@pvillard31 pvillard31 changed the title NIFI-16084 Fix flaky ConnectorAssetsIT by polling for asset removal NIFI-16104 Fix flaky ConnectorAssetsIT by polling for asset removal Jul 11, 2026
@pvillard31 pvillard31 added the type: testing Pull requests for changes to test components label Jul 11, 2026
@pvillard31
pvillard31 force-pushed the fix/connector-assets-flaky-test branch from 005a8c6 to 7a01224 Compare July 11, 2026 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: testing Pull requests for changes to test components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant