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][test]Flaky-test: SchemaServiceTest.testSchemaRegistryMetrics #23566

Merged
merged 1 commit into from
Nov 6, 2024

Conversation

visxu
Copy link
Contributor

@visxu visxu commented Nov 6, 2024

Fixes: #23457

Motivation

Error:  Tests run: 30, Failures: 1, Errors: 0, Skipped: 17, Time elapsed: 59.073 s <<< FAILURE! - in org.apache.pulsar.broker.service.schema.SchemaServiceTest
  Error:  org.apache.pulsar.broker.service.schema.SchemaServiceTest.testSchemaRegistryMetrics  Time elapsed: 0.053 s  <<< FAILURE!
  java.lang.AssertionError: expected [tenant/ns] but found [public/ns_73b1a31afce34671a5ddc48fe5ad7fc8]
  	at org.testng.Assert.fail(Assert.java:110)
  	at org.testng.Assert.failNotEquals(Assert.java:1577)
  	at org.testng.Assert.assertEqualsImpl(Assert.java:149)

It seems to be caused by lack of sufficient isolation between test runs.

Modifications

Use AssertJ fluent assertions instead of for iterate to do assertion check.

Verifying this change

  • Make sure that the change passes the CI checks.

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository:

Use `AssertJ` fluent assertions instead of `for` iterate.
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Nov 6, 2024
Copy link
Member

@lhotari lhotari left a comment

Choose a reason for hiding this comment

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

LGTM

@codecov-commenter
Copy link

codecov-commenter commented Nov 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.34%. Comparing base (bbc6224) to head (e12ea92).
Report is 718 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #23566      +/-   ##
============================================
+ Coverage     73.57%   74.34%   +0.77%     
- Complexity    32624    34336    +1712     
============================================
  Files          1877     1943      +66     
  Lines        139502   147059    +7557     
  Branches      15299    16211     +912     
============================================
+ Hits         102638   109333    +6695     
- Misses        28908    29305     +397     
- Partials       7956     8421     +465     
Flag Coverage Δ
inttests 27.58% <ø> (+3.00%) ⬆️
systests 24.41% <ø> (+0.09%) ⬆️
unittests 73.73% <ø> (+0.89%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 659 files with indirect coverage changes

@lhotari lhotari added this to the 4.1.0 milestone Nov 6, 2024
@lhotari lhotari merged commit 13133c1 into apache:master Nov 6, 2024
53 of 54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flaky-test: SchemaServiceTest.testSchemaRegistryMetrics
3 participants