-
Notifications
You must be signed in to change notification settings - Fork 7.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix unit test flake #41192
Fix unit test flake #41192
Conversation
@@ -46,15 +50,30 @@ func TestProfileList(t *testing.T) { | |||
|
|||
func TestProfileListByurl(t *testing.T) { | |||
g := gomega.NewWithT(t) | |||
args := []string{"profile", "list", "--dry-run", "--manifests", "https://github.com/istio/istio/releases/download/1.15.0/istio-1.15.0-linux-amd64.tar.gz"} | |||
tempChars := t.TempDir() | |||
defer os.RemoveAll(tempChars) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TempDir does this already
args := []string{"profile", "list", "--dry-run", "--manifests", "https://github.com/istio/istio/releases/download/1.15.0/istio-1.15.0-linux-amd64.tar.gz"} | ||
tempChars := t.TempDir() | ||
defer os.RemoveAll(tempChars) | ||
manifestsPath := filepath.Join(tempChars, "istio", "istio-1.15.0", "manifests") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use tgz.Create
like TestInstallPackagePath, it makes this whole thing 1 liner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually now that I think about it, TestInstallPackagePath already covers this entirely.. maybe we just delete this test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I think we can just delete the test.
/retest |
Please provide a description of this PR:
Fix #41099