Arquillian test against Payara/Glasfish failed due to `4848 port is already in use`

Not sure if it is related to the latest changes of the Github actions infra.

When setup-java v2 is released and I upgraded the workflow files to use setup-java@v2, all of the Arquillain tests against Payara/Glassfish failed in the following repositories:

Some days ago, when I returned to v1, it worked again. But now when returning back to v1, still failed due to 4848 port is already in use and failed to start Payara/Glassfish server before running Arquillian tests.

Not sure which process will use 4848. One possibility is the workflows are running in parallel with each other on the same machine, not a standalone environment or a single separate execution for every workflow.

The error never appeared in the past year.

I just removed two workflows in this repository,

Only left one workflow to run payara managed adapter, same result, same errors.

I thought it could be the root cause of running several Payara/Glassfish workflow in parallel but in the above jakartaee9-starter-boilerplate repository,

I also run two workflows for OpenLiberty, but they never failed.

I created a new Circle CI config, cargotracker/config.yml at 4f8fee90f148b867cbee785cd62b25d032d0bd3b · hantsy/cargotracker · GitHub, it uses the same scripts, the build is successful(never reports this error).

Confirmed from this issue: Upgrading to v2, error *4848 port is already used* in zulu · Issue #158 · actions/setup-java · GitHub

Every workflow runs on its own virtual machine. The possibility of port conflicts caused by running workflows in parallel can be eliminated.