You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2023/01/12 20:29:58 UTC
[GitHub] [pulsar] lhotari opened a new pull request, #19217: [improve][test] Prevent "Failed to register Collector of type Counter"
lhotari opened a new pull request, #19217:
URL: https://github.com/apache/pulsar/pull/19217
Fixes #19216
### Motivation
ProxyPrometheusMetricsTest is flaky. Please see #19216 for details.
### Modifications
- unregister collector after the test
- fix retries by adding null 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 -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] lhotari merged pull request #19217: [improve][test] Prevent "Failed to register Collector of type Counter"
Posted by GitBox <gi...@apache.org>.
lhotari merged PR #19217:
URL: https://github.com/apache/pulsar/pull/19217
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] lhotari commented on pull request #19217: [improve][test] Prevent "Failed to register Collector of type Counter"
Posted by GitBox <gi...@apache.org>.
lhotari commented on PR #19217:
URL: https://github.com/apache/pulsar/pull/19217#issuecomment-1381084031
There's a flaky assertion in the test case and after retry, the problem changed to the "Failed to register Collector of type Counter: test_counter_total is already in use by another Collector of type Counter" failure.
This issue was visible from the Unit-PROXY-surefire-reports.zip file and the `pulsar-proxy/target/surefire-reports/TEST-org.apache.pulsar.proxy.server.ProxyPrometheusMetricsTest.xml` xml file inside the zip file. The actual problem didn't get recorded in the console at all.
```xml
<testcase name="testMetrics" classname="org.apache.pulsar.proxy.server.ProxyPrometheusMetricsTest" time="0">
<skipped message="expected [1] but found [0]"/>
<system-out>
<![CDATA[ Created annotation listener ------- Starting test [TestClass name=class org.apache.pulsar.proxy.server.ProxyPrometheusMetricsTest].testMetrics([])------- 2023-01-12T22:26:42,592 - INFO - [pulsar-external-web-401-6:Slf4jRequestLogWriter@62] - 10.1.0.28 - - [12/Jan/2023:22:26:42 +0000] "GET /metrics HTTP/1.1" 302 0 "-" "Jersey/2.34 (HttpUrlConnection 17.0.5)" 1 2023-01-12T22:26:42,658 - INFO - [prometheus-stats-402-1:Slf4jRequestLogWriter@62] - 10.1.0.28 - - [12/Jan/2023:22:26:42 +0000] "GET /metrics/ HTTP/1.1" 200 4075 "-" "Jersey/2.34 (HttpUrlConnection 17.0.5)" 61 ]]>
</system-out>
<system-err>
<![CDATA[ Jan 12, 2023 10:26:37 PM org.glassfish.jersey.server.wadl.WadlFeature configure WARNING: JAXBContext implementation could not be found. WADL feature is disabled. Jan 12, 2023 10:26:37 PM org.glassfish.jersey.server.wadl.WadlFeature configure WARNING: JAXBContext implementation could not be found. WADL feature is disabled. Jan 12, 2023 10:26:38 PM org.glassfish.jersey.server.wadl.WadlFeature configure WARNING: JAXBContext implementation could not be found. WADL feature is disabled. Jan 12, 2023 10:26:40 PM org.glassfish.jersey.server.wadl.WadlFeature configure WARNING: JAXBContext implementation could not be found. WADL feature is disabled. Jan 12, 2023 10:26:41 PM org.glassfish.jersey.server.wadl.WadlFeature configure WARNING: JAXBContext implementation could not be found. WADL feature is disabled. Jan 12, 2023 10:26:41 PM org.glassfish.jersey.server.wadl.WadlFeature configure WARNING: JAXBContext implementation could not be found. WADL feature is disabled. Jan 12, 2023
10:26:42 PM org.glassfish.jersey.server.wadl.WadlFeature configure WARNING: JAXBContext implementation could not be found. WADL feature is disabled. Jan 12, 2023 10:26:42 PM org.glassfish.jersey.server.wadl.WadlFeature configure WARNING: JAXBContext implementation could not be found. WADL feature is disabled. ]]>
</system-err>
</testcase>
<testcase name="testMetrics" classname="org.apache.pulsar.proxy.server.ProxyPrometheusMetricsTest" time="0.022">
<failure message="Failed to register Collector of type Counter: test_counter_total is already in use by another Collector of type Counter" type="java.lang.IllegalArgumentException">java.lang.IllegalArgumentException: Failed to register Collector of type Counter: test_counter_total is already in use by another Collector of type Counter at io.prometheus.client.CollectorRegistry.register(CollectorRegistry.java:57) at io.prometheus.client.Collector.register(Collector.java:307) at io.prometheus.client.Collector.register(Collector.java:300) at org.apache.pulsar.proxy.server.ProxyPrometheusMetricsTest.testMetrics(ProxyPrometheusMetricsTest.java:99) 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.jav
a:568) at org.testng.internal.invokers.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:139) at org.testng.internal.invokers.InvokeMethodRunnable.runOne(InvokeMethodRunnable.java:47) at org.testng.internal.invokers.InvokeMethodRunnable.call(InvokeMethodRunnable.java:76) at org.testng.internal.invokers.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) </failure>
<system-out>
<![CDATA[ ~~~~~~~~~ SKIPPED -- [TestClass name=class org.apache.pulsar.proxy.server.ProxyPrometheusMetricsTest].testMetrics([])------- 2023-01-12T22:26:44,773 - INFO - [Thread-39:MetadataStoreCacheLoader@68] - Successfully updated broker info [] ------- Starting test [TestClass name=class org.apache.pulsar.proxy.server.ProxyPrometheusMetricsTest].testMetrics([])------- ]]>
</system-out>
<system-err>
<![CDATA[ Jan 12, 2023 10:26:45 PM org.glassfish.jersey.server.wadl.WadlFeature configure WARNING: JAXBContext implementation could not be found. WADL feature is disabled. Jan 12, 2023 10:26:45 PM org.glassfish.jersey.server.wadl.WadlFeature configure WARNING: JAXBContext implementation could not be found. WADL feature is disabled. Jan 12, 2023 10:26:47 PM org.glassfish.jersey.server.wadl.WadlFeature configure WARNING: JAXBContext implementation could not be found. WADL feature is disabled. Jan 12, 2023 10:26:49 PM org.glassfish.jersey.server.wadl.WadlFeature configure WARNING: JAXBContext implementation could not be found. WADL feature is disabled. Jan 12, 2023 10:26:50 PM org.glassfish.jersey.server.wadl.WadlFeature configure WARNING: JAXBContext implementation could not be found. WADL feature is disabled. Jan 12, 2023 10:26:50 PM org.glassfish.jersey.server.wadl.WadlFeature configure WARNING: JAXBContext implementation could not be found. WADL feature is disabled. Jan 12, 2023
10:26:50 PM org.glassfish.jersey.server.wadl.WadlFeature configure WARNING: JAXBContext implementation could not be found. WADL feature is disabled. Jan 12, 2023 10:26:50 PM org.glassfish.jersey.server.wadl.WadlFeature configure WARNING: JAXBContext implementation could not be found. WADL feature is disabled. ]]>
</system-err>
</testcase>
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] codecov-commenter commented on pull request #19217: [improve][test] Prevent "Failed to register Collector of type Counter"
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #19217:
URL: https://github.com/apache/pulsar/pull/19217#issuecomment-1380979022
# [Codecov](https://codecov.io/gh/apache/pulsar/pull/19217?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#19217](https://codecov.io/gh/apache/pulsar/pull/19217?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (8bce3ab) into [master](https://codecov.io/gh/apache/pulsar/commit/d7f8f56b5be5ad34cf1d33dd89b7bfc6a9ab94ff?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (d7f8f56) will **decrease** coverage by `10.54%`.
> The diff coverage is `0.00%`.
[](https://codecov.io/gh/apache/pulsar/pull/19217?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #19217 +/- ##
=============================================
- Coverage 47.89% 37.34% -10.55%
+ Complexity 10871 1995 -8876
=============================================
Files 713 209 -504
Lines 69730 14453 -55277
Branches 7496 1576 -5920
=============================================
- Hits 33394 5397 -27997
+ Misses 32631 8476 -24155
+ Partials 3705 580 -3125
```
| Flag | Coverage Δ | |
|---|---|---|
| unittests | `37.34% <0.00%> (-10.55%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/pulsar/pull/19217?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...va/org/apache/pulsar/client/impl/ProducerImpl.java](https://codecov.io/gh/apache/pulsar/pull/19217?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2NsaWVudC9pbXBsL1Byb2R1Y2VySW1wbC5qYXZh) | `15.62% <0.00%> (-0.04%)` | :arrow_down: |
| [...ulsar/broker/service/PulsarChannelInitializer.java](https://codecov.io/gh/apache/pulsar/pull/19217?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9zZXJ2aWNlL1B1bHNhckNoYW5uZWxJbml0aWFsaXplci5qYXZh) | | |
| [...er/systopic/NamespaceEventsSystemTopicFactory.java](https://codecov.io/gh/apache/pulsar/pull/19217?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9zeXN0b3BpYy9OYW1lc3BhY2VFdmVudHNTeXN0ZW1Ub3BpY0ZhY3RvcnkuamF2YQ==) | | |
| [...ar/broker/loadbalance/extensions/models/Split.java](https://codecov.io/gh/apache/pulsar/pull/19217?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9sb2FkYmFsYW5jZS9leHRlbnNpb25zL21vZGVscy9TcGxpdC5qYXZh) | | |
| [...ker/loadbalance/impl/LinuxBrokerHostUsageImpl.java](https://codecov.io/gh/apache/pulsar/pull/19217?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9sb2FkYmFsYW5jZS9pbXBsL0xpbnV4QnJva2VySG9zdFVzYWdlSW1wbC5qYXZh) | | |
| [...e/pulsar/common/naming/NamespaceBundleFactory.java](https://codecov.io/gh/apache/pulsar/pull/19217?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2NvbW1vbi9uYW1pbmcvTmFtZXNwYWNlQnVuZGxlRmFjdG9yeS5qYXZh) | | |
| [...ookkeeper/mledger/impl/PositionImplRecyclable.java](https://codecov.io/gh/apache/pulsar/pull/19217?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bWFuYWdlZC1sZWRnZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2Jvb2trZWVwZXIvbWxlZGdlci9pbXBsL1Bvc2l0aW9uSW1wbFJlY3ljbGFibGUuamF2YQ==) | | |
| [...d/bucket/BucketSnapshotSerializationException.java](https://codecov.io/gh/apache/pulsar/pull/19217?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9kZWxheWVkL2J1Y2tldC9CdWNrZXRTbmFwc2hvdFNlcmlhbGl6YXRpb25FeGNlcHRpb24uamF2YQ==) | | |
| [...pulsar/proxy/server/ServiceChannelInitializer.java](https://codecov.io/gh/apache/pulsar/pull/19217?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLXByb3h5L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9wdWxzYXIvcHJveHkvc2VydmVyL1NlcnZpY2VDaGFubmVsSW5pdGlhbGl6ZXIuamF2YQ==) | | |
| [...roker/systopic/TopicPoliciesSystemTopicClient.java](https://codecov.io/gh/apache/pulsar/pull/19217?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9zeXN0b3BpYy9Ub3BpY1BvbGljaWVzU3lzdGVtVG9waWNDbGllbnQuamF2YQ==) | | |
| ... and [497 more](https://codecov.io/gh/apache/pulsar/pull/19217?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] lhotari commented on pull request #19217: [improve][test] Prevent "Failed to register Collector of type Counter"
Posted by GitBox <gi...@apache.org>.
lhotari commented on PR #19217:
URL: https://github.com/apache/pulsar/pull/19217#issuecomment-1381096161
Now the actual flakiness is coming to surface
```
Error: Tests run: 2, Failures: 1, Errors: 0, Skipped: 1, Time elapsed: 15.921 s <<< FAILURE! - in org.apache.pulsar.proxy.server.ProxyPrometheusMetricsTest
Error: testMetrics(org.apache.pulsar.proxy.server.ProxyPrometheusMetricsTest) Time elapsed: 0.079 s <<< FAILURE!
java.lang.AssertionError: expected [1] but found [0]
at org.testng.Assert.fail(Assert.java:110)
at org.testng.Assert.failNotEquals(Assert.java:1413)
at org.testng.Assert.assertEqualsImpl(Assert.java:149)
at org.testng.Assert.assertEquals(Assert.java:131)
at org.testng.Assert.assertEquals(Assert.java:1240)
at org.testng.Assert.assertEquals(Assert.java:1274)
at org.apache.pulsar.proxy.server.ProxyPrometheusMetricsTest.testMetrics(ProxyPrometheusMetricsTest.java:118)
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.invokers.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:139)
at org.testng.internal.invokers.InvokeMethodRunnable.runOne(InvokeMethodRunnable.java:47)
at org.testng.internal.invokers.InvokeMethodRunnable.call(InvokeMethodRunnable.java:76)
at org.testng.internal.invokers.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)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org