Fixed flaky TestBackgroundCombinedOutputFailure (#978)

## Changes
`TestBackgroundCombinedOutputFailure` was occasionally failing because
combined output could have been in different order, see


https://github.com/databricks/cli/actions/runs/6823883271/job/18558675165?pr=928
This commit is contained in:
Andrew Nester 2023-11-10 15:09:02 +01:00 committed by GitHub
parent e82a49b4e9
commit ea4153e323
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -66,7 +66,10 @@ func TestBackgroundCombinedOutputFailure(t *testing.T) {
assert.Equal(t, "2", strings.TrimSpace(processErr.Stdout))
}
assert.Equal(t, "2", strings.TrimSpace(res))
assert.Equal(t, "1\n2\n", strings.ReplaceAll(buf.String(), "\r", ""))
out := strings.ReplaceAll(buf.String(), "\r", "")
assert.Contains(t, out, "1\n")
assert.Contains(t, out, "2\n")
}
func TestBackgroundNoStdin(t *testing.T) {