1
0
mirror of https://github.com/containers/buildah.git synced 2025-04-18 07:04:05 +03:00

unit: deparallize some tests

See issue: https://github.com/containers/buildah/issues/5967

Signed-off-by: flouthoc <flouthoc.git@gmail.com>
This commit is contained in:
flouthoc 2025-02-03 21:37:02 -08:00
parent 81479b200c
commit de3c3baf09
No known key found for this signature in database
GPG Key ID: 15CF19F7BADBE782
3 changed files with 18 additions and 3 deletions

View File

@ -40,7 +40,12 @@ 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.
// Tracked here: https://github.com/containers/buildah/issues/5967
ctx := context.TODO()
store, err := storage.GetStore(types.StoreOptions{
RunRoot: t.TempDir(),

View File

@ -21,7 +21,12 @@ 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.
// Tracked here: https://github.com/containers/buildah/issues/5967
ctx := context.TODO()
now := time.Now()

View File

@ -66,7 +66,12 @@ 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.
// Tracked here: https://github.com/containers/buildah/issues/5967
ctx := context.TODO()
for _, status := range []int{http.StatusOK, http.StatusInternalServerError} {
for _, ignoreChainRetrievalErrors := range []bool{false, true} {