merlimat opened a new pull request, #25645:
URL: https://github.com/apache/pulsar/pull/25645
## Summary
The `pulsar_schema_*_ops_failed_total` counters in `SchemaRegistryStats` are
registered on the **default Prometheus registry** — a JVM-wide static. Labels
accumulated by other tests (or by broker-internal failed schema gets unrelated
to this test) survive across `@BeforeMethod` broker restarts. So asserting
`collection.size() == 0` fails non-deterministically whenever any prior code
path observed a failed op.
Filter the assertion to the test's own namespace:
```java
assertThat(getMetrics).noneMatch(metric ->
namespace.equals(metric.tags.get("namespace")));
```
This catches the bug the test was meant to catch (this test's ops shouldn't
increment failed counters) without being polluted by global counter state.
## Test plan
- [x] Test passes locally with the change applied
- [ ] CI is green
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]