Skip to content

Commit

Permalink
unit: deparallize some tests
Browse files Browse the repository at this point in the history
Signed-off-by: flouthoc <[email protected]>
  • Loading branch information
flouthoc committed Jan 30, 2025
1 parent 1f4ebaa commit 07d769c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
6 changes: 5 additions & 1 deletion buildah_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ func TestMain(m *testing.M) {
}

func TestOpenBuilderCommonBuildOpts(t *testing.T) {
t.Parallel()
// This test cannot be parallized as this uses NewBuilder()
// which eventually and indirectly accesses a global variable
// defined in `go-selinux`, this must be fixed at `go-selinux`
// or builder must enable sometime of locking mechanism i.e if
// routine is creating Builder other's must wait for it.
ctx := context.TODO()
store, err := storage.GetStore(types.StoreOptions{
RunRoot: t.TempDir(),
Expand Down
6 changes: 5 additions & 1 deletion commit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ import (
)

func TestCommitLinkedLayers(t *testing.T) {
t.Parallel()
// This test cannot be parallized as this uses NewBuilder()
// which eventually and indirectly accesses a global variable
// defined in `go-selinux`, this must be fixed at `go-selinux`
// or builder must enable sometime of locking mechanism i.e if
// routine is creating Builder other's must wait for it.
ctx := context.TODO()
now := time.Now()

Expand Down
6 changes: 5 additions & 1 deletion convertcw_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ func (d *dummyAttestationHandler) ServeHTTP(rw http.ResponseWriter, req *http.Re
}

func TestCWConvertImage(t *testing.T) {
t.Parallel()
// This test cannot be parallized as this uses NewBuilder()
// which eventually and indirectly accesses a global variable
// defined in `go-selinux`, this must be fixed at `go-selinux`
// or builder must enable sometime of locking mechanism i.e if
// routine is creating Builder other's must wait for it.
ctx := context.TODO()
for _, status := range []int{http.StatusOK, http.StatusInternalServerError} {
for _, ignoreChainRetrievalErrors := range []bool{false, true} {
Expand Down

0 comments on commit 07d769c

Please sign in to comment.