elastic / elastic/apm-agent-java

Independant module for test/jvm tools

Open
#2,185 2 comments 1 reaction 0 assignees View on GitHub
chore size:small stretch technical-debt
Dominant language
Java
Stars
594
Forks
338
Avg merge
1d 13h
Merged PRs (30d)
25

Description

We have some duplicated implementations of the following (non-exhaustive list, please add other relevant items if needed).
- [ ] (test) get a random available port (see usages of `co.elastic.apm.agent.testutils.TestPort` and `javax.net.ServerSocketFactory#createServerSocket(int, int, java.net.InetAddress)`)
- [ ] (test) locate packaged artifacts from classpath/relative path (see `co.elastic.apm.servlet.AgentFileAccessor#getTargetJar(java.lang.String, java.lang.String)`)
- [ ] find path to the JVM binary (`getJavaBinaryPath`).
- [ ] shutdown thread pools properly with `co.elastic.apm.agent.util.ExecutorUtils`, used both in tests and in production code.

Duplication is the the result of the following:
- not every module has a dependency on `apm-agent-core` hence code reuse is limited
- there is no root module that can host them

The goal would be to create one (or more) modules that provide
- all the test-only features in the `test` scope so it can be reused in any other module testing
- other items in the `compile` scope
- no dependency on other agent modules, only common libraries (slf4j, junit, ...).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.