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] [branch-2.11] fix testEscapeLabelValue failed #21346

Conversation

horizonzy
Copy link
Member

@horizonzy horizonzy commented Oct 12, 2023

Motivation

At the branch master, the test can be passed,
At branch-2.11, the NamespaceStatsAggregator#printDefaultBrokerStats will append the pulsar_subscriptions_count. This logic has been removed at the master branch.
https://github.com/apache/pulsar/blob/2a3b96a39c6595d7ac978e22284ac315784f25d8/pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/NamespaceStatsAggregator.java#L309C30-L309C56

At the topic level, it will also print pulsar_subscriptions_count. So the test will be failed.

The failed test:

Error:  testEscapeLabelValue(org.apache.pulsar.broker.stats.PrometheusMetricsTest)  Time elapsed: 0.146 s  <<< FAILURE!
  java.lang.AssertionError: expected [1] but found [2]
  	at org.testng.Assert.fail(Assert.java:99)
  	at org.testng.Assert.failNotEquals(Assert.java:1037)
  	at org.testng.Assert.assertEqualsImpl(Assert.java:140)
  	at org.testng.Assert.assertEquals(Assert.java:122)
  	at org.testng.Assert.assertEquals(Assert.java:907)
  	at org.testng.Assert.assertEquals(Assert.java:917)
  	at org.apache.pulsar.broker.stats.PrometheusMetricsTest.testEscapeLabelValue(PrometheusMetricsTest.java:1758)
  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
  	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
  	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:132)
  	at org.testng.internal.InvokeMethodRunnable.runOne(InvokeMethodRunnable.java:45)
  	at org.testng.internal.InvokeMethodRunnable.call(InvokeMethodRunnable.java:73)
  	at org.testng.internal.InvokeMethodRunnable.call(InvokeMethodRunnable.java:11)
  	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
  	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
  	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
  	at java.base/java.lang.Thread.run(Thread.java:833)

Documentation

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

@github-actions
Copy link

@horizonzy Please add the following content to your PR description and select a checkbox:

- [ ] `doc` <!-- Your PR contains doc changes -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [ ] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->

@github-actions github-actions bot added doc-not-needed Your PR changes do not impact docs and removed doc-label-missing labels Oct 12, 2023
@horizonzy
Copy link
Member Author

/pulsarbot rerun-failure-checks

@horizonzy horizonzy changed the title [fix] [test]Branch [branch-2.11] fix testEscapeLabelValue failed [fix] [test] [branch-2.11] fix testEscapeLabelValue failed Oct 15, 2023
@hangc0276
Copy link
Contributor

/pulsarbot rerun-failure-checks

@Technoboy- Technoboy- merged commit 12c4a02 into apache:branch-2.11 Oct 16, 2023
69 of 85 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.

None yet

5 participants