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

Tracing::ThreadUsageResourceAccountant cannot be isolated and tested in integration tests #15231

Open
vrajat opened this issue Mar 10, 2025 · 1 comment
Assignees
Labels

Comments

@vrajat
Copy link
Collaborator

vrajat commented Mar 10, 2025

In integration tests, brokers and servers run in the same JVM. All of them share the same ThreadUsageResourceAccountant in a singleton in Tracing.java. This makes certain kinds of tests hard to write. For example:

Some tests use InterruptingAccountant. This class is useful to inject errors in the broker. However, it is not possible to inject errors in servers as the broker will error out first.

Couple of options are:

  • Run a server in a different JVM. This is a major change in how tests have to be written. It will also make debug mode harder.
  • Use dependency injection rather than a singleton to pass around an accountant object.
@vrajat vrajat added the testing label Mar 10, 2025
@vrajat vrajat self-assigned this Mar 10, 2025
@vrajat
Copy link
Collaborator Author

vrajat commented Mar 10, 2025

cc @jasperjiaguo @vvivekiyer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant