Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix][flaky-test]PerformanceTransactionTest.testConsumeTxnMessage #17837

Merged
merged 1 commit into from
Sep 29, 2022

Conversation

poorbarcode
Copy link
Contributor

@poorbarcode poorbarcode commented Sep 26, 2022

Fixes: #14109

Motivation

The expected execution flow for this test is:

  1. send 505 messages
  2. commit 10 transactions, every transaction ack 50 messages
  3. receive the last 5 messages in the last transaction, wait for transaction timeout
  4. confirm that the last 5 messages can be consumed by new consumer

(High light) The default value for transaction TTL is 10 seconds, and the default value for Awaitility.await is also 10 seconds, so this test is not stable.

Note: This is a guess cause, the problem is not reproduced locally. But after transaction TTL is set to 11s, the probability of the problem occurring is 100%.

Modifications

Fix flaky test

  • set transaction TTL to 5s

Other changes

  • define a name for the task thread
  • acknowledge the last 5 messages

Documentation

  • doc-required

  • doc-not-needed

  • doc

  • doc-complete

Matching PR in forked repository

PR in forked repository:

@github-actions
Copy link

@poorbarcode Please provide a correct documentation label for your PR.
Instructions see Pulsar Documentation Label Guide.

@poorbarcode
Copy link
Contributor Author

Can this PR merge? (^_^)

@congbobo184 congbobo184 merged commit dc44ea2 into apache:master Sep 29, 2022
@poorbarcode poorbarcode deleted the flaky/testConsumeTxnMessage branch September 29, 2022 12:32
congbobo184 pushed a commit that referenced this pull request Nov 3, 2022
<!--
### Contribution Checklist
  
  - PR title format should be *[type][component] summary*. For details, see *[Guideline - Pulsar PR Naming Convention](https://docs.google.com/document/d/1d8Pw6ZbWk-_pCKdOmdvx9rnhPiyuxwq60_TrD68d7BA/edit#heading=h.trs9rsex3xom)*. 

  - Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
  
  - Each pull request should address only one issue, not mix up code from multiple issues.
  
  - Each commit in the pull request has a meaningful commit message

  - Once all items of the checklist are addressed, remove the above text and this checklist, leaving only the filled out template below.
-->

<!-- Either this PR fixes an issue, -->

Fixes #18282


### Modifications

We start 10 transactions and consume 50 messages in every transaction by default.

But notice `-r 10` set the consumption rate limit to be 10 msg per second, so every transaction is about 5 seconds.

In #17837 we set the transaction TTL to be 5 seconds, so transactions may be timeout randomly, which causes the test to fail.

To prove this, you can try to set `-r 9` or `-tto 4`, which will cause failure 100%.

So remove the `-r` option can fix this issue.

### Verifying this change

- [x] Make sure that the change passes the CI checks.

### Documentation

<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->

- [ ] `doc` <!-- Your PR contains doc changes. Please attach the local preview screenshots (run `sh start.sh` at `pulsar/site2/website`) to your PR description, or else your PR might not get merged. -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->

### Matching PR in forked repository

PR in forked repository: labuladong#6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-not-needed Your PR changes do not impact docs ready-to-test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flaky-test: PerformanceTransactionTest.testConsumeTxnMessage
4 participants