mirror of https://github.com/databricks/cli.git
Do not run mlops-stacks integration test in parallel (#1982)
## Changes This test changes the cwd using the `testutil.Chdir` function. This causes flakiness with other integration tests, like `TestAccWorkspaceFilesExtensionsNotebooksAreNotDeletedAsFiles`, which rely on the cwd being configured correctly to read test fixtures. The `t.Setenv` call in `testutil.Chdir` ensures that it is not run from a test whose upstream is executing in parallel.
This commit is contained in:
parent
227a13556b
commit
e0d54f0bb6
|
@ -39,7 +39,6 @@ func TestAccBundleInitErrorOnUnknownFields(t *testing.T) {
|
||||||
// make changes that can break the MLOps Stacks DAB. In which case we should
|
// make changes that can break the MLOps Stacks DAB. In which case we should
|
||||||
// skip this test until the MLOps Stacks DAB is updated to work again.
|
// skip this test until the MLOps Stacks DAB is updated to work again.
|
||||||
func TestAccBundleInitOnMlopsStacks(t *testing.T) {
|
func TestAccBundleInitOnMlopsStacks(t *testing.T) {
|
||||||
t.Parallel()
|
|
||||||
env := testutil.GetCloud(t).String()
|
env := testutil.GetCloud(t).String()
|
||||||
|
|
||||||
tmpDir1 := t.TempDir()
|
tmpDir1 := t.TempDir()
|
||||||
|
|
|
@ -51,6 +51,10 @@ func GetEnvOrSkipTest(t *testing.T, name string) string {
|
||||||
// Changes into specified directory for the duration of the test.
|
// Changes into specified directory for the duration of the test.
|
||||||
// Returns the current working directory.
|
// Returns the current working directory.
|
||||||
func Chdir(t *testing.T, dir string) string {
|
func Chdir(t *testing.T, dir string) string {
|
||||||
|
// Prevent parallel execution when changing the working directory.
|
||||||
|
// t.Setenv automatically fails if t.Parallel is set.
|
||||||
|
t.Setenv("DO_NOT_RUN_IN_PARALLEL", "true")
|
||||||
|
|
||||||
wd, err := os.Getwd()
|
wd, err := os.Getwd()
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue