opentelemetry-java-instrumentation icon indicating copy to clipboard operation
opentelemetry-java-instrumentation copied to clipboard

OSHI test failure on Apple Silicon processors

Open zackman0010 opened this issue 1 year ago • 2 comments

Describe the bug

When attempting to run the tests on my Mac M1 processor, the OSHI tests fail with JNA related errors. Upon investigation, I found https://github.com/oshi/oshi/issues/1462, which shows that M1 support was added to JNA 5.7/OSHI 5.5. The version of OSHI currently used in OTel is 5.3.1. I've upped this to 5.5.0 locally so I could run the tests, but should this change be made for everyone?

Steps to reproduce

Run tests on Apple Silicon processor

Expected behavior

Successful tests

Actual behavior

Failed tests

Javaagent or library instrumentation version

27225829

Environment

JDK: Temurin 17.0.3 OS: macOS Sonoma 14.0 on M1 processor

Additional context

No response

zackman0010 avatar Apr 11 '24 16:04 zackman0010

hey @zackman0010, we typically run instrumentation tests against the earliest version of an instrumented library that we support

the oshi instrumentation is a bit unique though in that we don't so much instrument it, as much as we require the user to bring it (so that it doesn't impact the javaagent jar size for everyone as it's several MB)

i'd support bumping the version we test against to 5.5.0, @laurit wdyt?

trask avatar Apr 12 '24 00:04 trask

We have previously done one workaround for M1 https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/7ff3b23f101c41462850fc31ed0bc01229bd34c6/instrumentation/grpc-1.6/testing/build.gradle.kts#L40-L43 I think you can get the arch from osdetector and set the version to 5.5.0 when running on arm and osx (idk whether the osx check would be needed) and otherwise keep it at whatever it is now.

laurit avatar Apr 12 '24 06:04 laurit