Skip to content

NIFI-15753 - Flaky test PollingKinesisClientTest.testCloseTerminatesAllFetchingAndDrainsQueue#11050

Open
pvillard31 wants to merge 2 commits intoapache:mainfrom
pvillard31:NIFI-15753
Open

NIFI-15753 - Flaky test PollingKinesisClientTest.testCloseTerminatesAllFetchingAndDrainsQueue#11050
pvillard31 wants to merge 2 commits intoapache:mainfrom
pvillard31:NIFI-15753

Conversation

@pvillard31
Copy link
Copy Markdown
Contributor

@pvillard31 pvillard31 commented Mar 26, 2026

Summary

NIFI-15753 - Flaky test PollingKinesisClientTest.testCloseTerminatesAllFetchingAndDrainsQueue

Error:  Tests run: 12, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 1.460 s <<< FAILURE! -- in org.apache.nifi.processors.aws.kinesis.PollingKinesisClientTest
Error:  org.apache.nifi.processors.aws.kinesis.PollingKinesisClientTest.testCloseTerminatesAllFetchingAndDrainsQueue -- Time elapsed: 0.016 s <<< FAILURE!
org.opentest4j.AssertionFailedError: After close, hasPendingFetches must return false ==> expected: <false> but was: <true>
	at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:158)
	at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:139)
	at org.junit.jupiter.api.AssertFalse.failNotFalse(AssertFalse.java:69)
	at org.junit.jupiter.api.AssertFalse.assertFalse(AssertFalse.java:41)
	at org.junit.jupiter.api.Assertions.assertFalse(Assertions.java:255)
	at org.apache.nifi.processors.aws.kinesis.PollingKinesisClientTest.testCloseTerminatesAllFetchingAndDrainsQueue(PollingKinesisClientTest.java:317)

Error:  Failures: 
Error:    PollingKinesisClientTest.testCloseTerminatesAllFetchingAndDrainsQueue:317 After close, hasPendingFetches must return false ==> expected: <false> but was: <true>
Error:  org.apache.nifi.processors.aws.kinesis.PollingKinesisClientTest.testExpiredIteratorRecoveryDoesNotDeliverSameShardOutOfOrder -- Time elapsed: 0.239 s <<< FAILURE!
org.opentest4j.AssertionFailedError: Queue must contain results after iterator recovery ==> expected: not <null>
	at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:159)
	at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:139)
	at org.junit.jupiter.api.AssertNotNull.failNull(AssertNotNull.java:55)
	at org.junit.jupiter.api.AssertNotNull.assertNotNull(AssertNotNull.java:40)
	at org.junit.jupiter.api.Assertions.assertNotNull(Assertions.java:334)
	at org.apache.nifi.processors.aws.kinesis.PollingKinesisClientTest.testExpiredIteratorRecoveryDoesNotDeliverSameShardOutOfOrder(PollingKinesisClientTest.java:249)

Error:  Failures: 
Error:    PollingKinesisClientTest.testExpiredIteratorRecoveryDoesNotDeliverSameShardOutOfOrder:249 Queue must contain results after iterator recovery ==> expected: not <null>

Tracking

Please complete the following tracking steps prior to pull request creation.

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 contains commits signed with a registered key indicating Verified status

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

  • New dependencies are compatible with the Apache License 2.0 according to the License Policy
  • New dependencies are documented in applicable LICENSE and NOTICE files

Documentation

  • Documentation formatting appears as expected in rendered files

@pvillard31 pvillard31 requested a review from markap14 March 26, 2026 17:03
@pvillard31 pvillard31 added the type: testing Pull requests for changes to test components label Mar 26, 2026
Copy link
Copy Markdown
Contributor

@exceptionfactory exceptionfactory left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @pvillard31, I've also noticed the sporadic failures. I noted on implementation suggestion.

private final Semaphore queuePermits = new Semaphore(MAX_QUEUED_RESULTS, true);
private final long emptyShardBackoffNanos;
private final long errorBackoffNanos;
private volatile boolean closed;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of adding the closed variable, what about using the ExecutorService.isShutdown() method as an indicator of closed status?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes good point, that's cleaner

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.

2 participants