Fix randomly failing test from commands/single_test.go

Merged Tomasz Maczukin requested to merge fix-failing-test-for-single-command into master

What does this MR do?

Fixes randomly failing tests from commands/single_test.go in a way proposed at https://gitlab.com/gitlab-org/gitlab-runner/merge_requests/683#note_40207766. Replacement for !683 (closed).

Why was this MR needed?

Please look into !683 (closed) for a reference.

Are there points in the code the reviewer needs to double check?

Does this MR meet the acceptance criteria?

  • Documentation created/updated
  • Tests
    • Added for this feature/bug
    • All builds are passing
  • Branch has no merge conflicts with master (if you do - rebase it please)

What are the relevant issue numbers?

Edited by Tomasz Maczukin