question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Intermittent test failure in PersistentTopicTest.testClosingReplicationProducerTwice

See original GitHub issue

As seen in

https://builds.apache.org/job/pulsar-pull-request/org.apache.pulsar$pulsar-broker/1344/testReport/junit/org.apache.pulsar.broker.service/PersistentTopicTest/testClosingReplicationProducerTwice/

org.mockito.exceptions.verification.TooManyActualInvocations: 

pulsarClientImpl.createProducerAsync(
    "persistent://prop/global/ns/testClosingReplicationProducerTwice",
    org.apache.pulsar.client.api.ProducerConfiguration@f74e835
);
Wanted 1 time:
-> at org.apache.pulsar.broker.service.PersistentTopicTest.testClosingReplicationProducerTwice(PersistentTopicTest.java:965)
But was 2 times. Undesired invocation:
-> at org.apache.pulsar.broker.service.AbstractReplicator.startProducer(AbstractReplicator.java:124)

	at org.apache.pulsar.broker.service.PersistentTopicTest.testClosingReplicationProducerTwice(PersistentTopicTest.java:965)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ivankellycommented, Mar 7, 2018

Found the race. The builder stuff messed up this test completely, but the race is still there. Just put a 1s sleep after creating the replicator. Problem is ultimately that the mock should be applied before creating the replicator, because the replicator calls startProducer on construction, which will fail, and the call it again after a backoff, which is where the extra invokations are.

I’ll submit a patch tomorrow.

0reactions
sijiecommented, Apr 25, 2018

The fix is contributed by @ivankelly

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix Flaky Tests - Semaphore CI
A test that intermittently fails for no apparent reason — or works in ... and fails with continuous integration — is called a...
Read more >
Intermittent test failures when upgrading from 3.3 to 3.4.16
16 and I'm now seeing intermittent errors in my tests. The tests are using React and @testing-library/react with jest. The main issue is...
Read more >
Flaky tests - GitLab Docs
When a test frequently fails in master , create a ~"failure::flaky-test" issue. If the test cannot be fixed in a timely fashion, there...
Read more >
Fixing Flaky Time Based Unit Tests | by EG Tech - Medium
Another very common source of intermittent failures are tests that fail when they run:
Read more >
How to reduce flaky test failures - CircleCI
It is essential to understand whether a test has failed due to flakiness or a genuine application issue. If it is a flaky...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found