Skip to content
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

tests: add tests for wait-paths #1384

Merged
merged 2 commits into from
May 4, 2022
Merged

Conversation

anmaxvl
Copy link
Contributor

@anmaxvl anmaxvl commented Apr 30, 2022

Follow up PR to add tests for wait-paths after initial PR #1258
was merged.

Signed-off-by: Maksim An [email protected]

@anmaxvl anmaxvl requested a review from a team as a code owner April 30, 2022 00:19
Follow up PR to add tests for wait-paths after initial PR microsoft#1258
was merged.

Signed-off-by: Maksim An <[email protected]>
Copy link
Contributor

@helsaawy helsaawy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple concerns with the tests, but no major issues.

cmd/hooks/wait-paths/main.go Show resolved Hide resolved
cmd/hooks/wait-paths/wait_paths_test.go Outdated Show resolved Hide resolved
cmd/hooks/wait-paths/wait_paths_test.go Outdated Show resolved Hide resolved
cmd/hooks/wait-paths/wait_paths_test.go Outdated Show resolved Hide resolved
cmd/hooks/wait-paths/wait_paths_test.go Outdated Show resolved Hide resolved
}
}()

if err := <-errChan; err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as a weird edge case, if app.Run() returns nil before the create file go routines runs, this will succeed, and then not only will any errors from os.Create be ignored, but errChan <- err will panic.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another edge case: app.Run() returns an error and we close the error channel before the subroutine to create the files runs/finishes running. We may end up causing a panic by writing to a closed chan.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lmk if the updated implementation works for you.

@katiewasnothere
Copy link
Contributor

couple comments in line with Hamza's review, otherwise looks good

@anmaxvl anmaxvl force-pushed the tests/wait-paths branch from dc0cb36 to 9c472f5 Compare May 3, 2022 01:05
Signed-off-by: Maksim An <[email protected]>
@anmaxvl anmaxvl force-pushed the tests/wait-paths branch from 9c472f5 to c2975a4 Compare May 3, 2022 01:05
@anmaxvl anmaxvl merged commit 1c049f1 into microsoft:master May 4, 2022
@anmaxvl anmaxvl deleted the tests/wait-paths branch May 4, 2022 21:56
anmaxvl added a commit that referenced this pull request Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants