0

Trying to run my unit tests after migrating to an M2 MacBook I'm seeing this:

IllegalState Could not start Hoverfly process

and searching further in the log I find more info:

[ERROR] net.openid.conformance.condition.client.FetchServerKeys_UnitTest  Time elapsed: 0.061 s  <<< ERROR!
java.lang.IllegalStateException: Could not start Hoverfly process
Caused by: org.zeroturnaround.exec.ProcessInitException: Could not execute [/var/folders/dq/x26v4s_15nz6mqx739h9lw4h0000gn/T/hoverfly.14116433907436916338/hoverfly_OSX_amd64, -pp, 51942, -ap, 51943, -logs, json] in /var/folders/dq/x26v4s_15nz6mqx739h9lw4h0000gn/T/hoverfly.14116433907436916338. Error=86, Bad CPU type in executable
Caused by: java.io.IOException: Cannot run program "/var/folders/dq/x26v4s_15nz6mqx739h9lw4h0000gn/T/hoverfly.14116433907436916338/hoverfly_OSX_amd64" (in directory "/var/folders/dq/x26v4s_15nz6mqx739h9lw4h0000gn/T/hoverfly.14116433907436916338"): error=86, Bad CPU type in executable
Caused by: java.io.IOException: error=86, Bad CPU type in executable

However googling doesn't show anyone else getting this error.

JosephH
  • 37,173
  • 19
  • 130
  • 154

1 Answers1

0

Looking further in the log file you'll find:

io.specto.hoverfly.junit.core.TempFileManager - Selecting the following binary based on the current operating system: hoverfly_OSX_amd64

i.e. it's trying to run the Intel binary rather than the arm64 one, and failing.

This happens on an M1/M2 Mac, and it would have be fine if Rosetta2 was installed.

hoverfly-java only recently had support for a native arm64 binary added; if you upgrade to 0.14.4 that will fix the issue and it will work without Rosetta.

JosephH
  • 37,173
  • 19
  • 130
  • 154