Building Unity Project in CLI issues with BeeDriver

Hi, i’ve been trying to use the gitlab ci for Unity (which is just a Unity CLI in a container), however i’m getting an error without any explanation.

[181/183   43s] GenerateNativePluginsForAssemblies Library/Bee/artifacts/WinPlayerBuildProgram/AsyncPluginsFromLinker
##### CommandLine
GenerateNativePluginsForAssemblies
##### ExitCode
-1
##### Output
BeeDriver connection terminated
*** Tundra build interrupted (44.01 seconds), 138 items updated, 180 evaluated

For the context i’m starting the building process with the following build.sh :

#!/usr/bin/env bash

set -e
set -x


# LOG_FILE="$UNITY_DIR/Builds/unity_build.log"

# Function to handle unexpected terminations
cleanup() {
  echo "Build process interrupted or failed."
}

# Set trap to call cleanup function on script exit
trap cleanup EXIT

echo "Building for $BUILD_TARGET"

export BUILD_PATH=$UNITY_DIR/Builds/$BUILD_TARGET/
mkdir -p $BUILD_PATH

${UNITY_EXECUTABLE:-xvfb-run --auto-servernum --server-args='-screen 0 640x480x24' unity-editor} \
  -projectPath $UNITY_DIR \
  -quit \
  -batchmode \
  -nographics \
  -buildTarget $BUILD_TARGET \
  -customBuildTarget $BUILD_TARGET \
  -customBuildName $BUILD_NAME \
  -customBuildPath $BUILD_PATH \
  -executeMethod BuildCommand.PerformBuild \
  -logFile /dev/stdout

UNITY_EXIT_CODE=$?

if [ $UNITY_EXIT_CODE -eq 0 ]; then
  echo "Run succeeded, no failures occurred";
elif [ $UNITY_EXIT_CODE -eq 2 ]; then
  echo "Run succeeded, some tests failed";
elif [ $UNITY_EXIT_CODE -eq 3 ]; then
  echo "Run failure (other failure)";
else
  echo "Unexpected exit code $UNITY_EXIT_CODE";
fi

ls -la $BUILD_PATH
[ -n "$(ls -A $BUILD_PATH)" ] # fail job if build folder is empty

The Docker’s image is : unityci/editor:ubuntu-6000.0.19f1-windows-mono-3.1.0

I have a theory about why this happened. It could be because I had three runners working on the project simultaneously (two running tests and one handling the build), all sharing the same cached library. It’s possible they interfered with each other.

To address this, I divided the process into two stages: one runner for the build and two for tests running concurrently. This setup appears to have resolved the issue.

I have still no ideas why i had the error, however i don’t have it now.