Skip to content

test: Fix test Test_repoArchive_Integration integration test

Description

As observed in https://gitlab.com/gitlab-org/cli/-/jobs/4785867150#L192, this integration test has been failing occasionally. Logging was added which found that the root cause was the following error:

{"Time":"2023-08-01T23:42:35.891151618Z","Action":"output","Package":"gitlab.com/gitlab-org/cli/commands/project/archive","Test":"Test_repoArchive_Integration/Repo_is_invalid","Output":"    repo_archive_integration_test.go:59: fork/exec /builds/gitlab-org/cli/testdata/glab.test: text file busy\n"}

The issue is best summarised by https://go.googlesource.com/go/+/go1.9.5/src/cmd/go/internal/work/build.go#2018 and this MR uses the same fix, which is basically to wait a short amount of time and retry if a text file is busy error occurs. Presumably this is happening because we are building the binary and then immediately executing a command against it.

An alternative solution would be to remove this test altogether, but with this MR we will be able to keep the test running.

Related Issues

Resolves #1381 (closed)

How has this been tested?

Pipeline

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation
  • Chore (Related to CI or Packaging to platforms)
  • Test gap

Closes #1381 (closed)

Edited by Jay McCure

Merge request reports