Script fails when run with gitlab-runner, but passes manually

Hello, I am running a ‘sudo make run’ command in one of my scripts section of a job, and it fails, returning exit status 1, but when I manually log into the machine as another user and run the same command, it succeeds. It also looks like the script is ending prematurely as the ‘Error: exit 1’ shows up right in the middle of another output.

Is there some timer on the script when launched in gitlab-runner, because the command takes about 5 minutes to complete. Is there a way to run the command exactly as a gitlab-runner? Like logging into the machine as gitlab-runner user and running the command? I tried this, but it prompt for a password to log into the machine.

Thanks

I sort of figured it out. Gitlab-Runner threw an exception:

BlockingIOError(11, ‘write could not complete without blocking’,)

It was complaining that profiler.print_stats() was printing for too long. Once I removed it, gitlab-runner completed.