Revert "tests/image: run the tests in parallel (somewhat)"
Running tests in parallel is not stable under all conditions, this commit
removes it to make the tests more reliable.
This reverts commit e890e03d
This commit is contained in:
parent
7403c5b368
commit
d02e77de06
1 changed files with 3 additions and 21 deletions
|
|
@ -15,18 +15,17 @@ import (
|
|||
"os/exec"
|
||||
"path"
|
||||
"strings"
|
||||
"sync"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"github.com/gophercloud/gophercloud"
|
||||
"github.com/gophercloud/gophercloud/openstack"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/cmd/osbuild-image-tests/azuretest"
|
||||
"github.com/osbuild/osbuild-composer/cmd/osbuild-image-tests/openstacktest"
|
||||
"github.com/osbuild/osbuild-composer/cmd/osbuild-image-tests/constants"
|
||||
"github.com/osbuild/osbuild-composer/cmd/osbuild-image-tests/openstacktest"
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
)
|
||||
|
||||
|
|
@ -45,18 +44,8 @@ type testcaseStruct struct {
|
|||
|
||||
var disableLocalBoot = flag.Bool("disable-local-boot", false, "when this flag is given, no images are booted locally using qemu (this does not affect testing in clouds)")
|
||||
|
||||
// mutex to enforce only one osbuild instance run at a time, see below
|
||||
var osbuildMutex sync.Mutex
|
||||
|
||||
// runOsbuild runs osbuild with the specified manifest and output-directory.
|
||||
func runOsbuild(manifest []byte, store, outputDirectory string) error {
|
||||
// Osbuild crashes when multiple instances are run at a time.
|
||||
// This mutex enforces that there's always just one osbuild instance.
|
||||
// This should be removed once osbuild is fixed.
|
||||
// See https://github.com/osbuild/osbuild/issues/351
|
||||
osbuildMutex.Lock()
|
||||
defer osbuildMutex.Unlock()
|
||||
|
||||
cmd := constants.GetOsbuildCommand(store, outputDirectory)
|
||||
|
||||
cmd.Stdin = bytes.NewReader(manifest)
|
||||
|
|
@ -472,13 +461,6 @@ func runTests(t *testing.T, cases []string) {
|
|||
t.Skipf("the required arch is %s, the current arch is %s", testcase.ComposeRequest.Arch, currentArch)
|
||||
}
|
||||
|
||||
// Run the test in parallel
|
||||
// The t.Parallel() call is after the skip conditions, because
|
||||
// the skipped tests are short and there's no need to run
|
||||
// them in parallel and create more goroutines.
|
||||
// Also the output is clearer this way.
|
||||
t.Parallel()
|
||||
|
||||
runTestcase(t, testcase, store)
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue