Skip to content

Commit

Permalink
Adding Fix for flakey test caused while buildng bicep template (#7345)
Browse files Browse the repository at this point in the history
# Description

Added changes to sequentialy copy the stdout to buffer instead of
copying it asynchronously.

## Type of change

<!--

Please select **one** of the following options that describes your
change and delete the others. Clearly identifying the type of change you
are making will help us review your PR faster, and is used in authoring
release notes.

If you are making a bug fix or functionality change to Radius and do not
have an associated issue link please create one now.

-->

- This pull request fixes a bug in Radius and has an approved issue
(issue link required).
<!--

Please update the following to link the associated issue. This is
required for some kinds of changes (see above).

-->

Fixes: #7194

Signed-off-by: Vishwanath Hiremath <[email protected]>
  • Loading branch information
vishwahiremat authored Mar 19, 2024
1 parent 48b5256 commit a58a5d5
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pkg/cli/bicep/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,10 @@ func runBicepRaw(args ...string) ([]byte, error) {
return nil, fmt.Errorf("failed executing %q: %w", fullCmd, err)
}

// asynchronously copy to our buffer, we don't really need to observe
// copy to our buffer, we don't really need to observe
// errors here since it's copying into memory
buf := bytes.Buffer{}
go func() {
_, _ = io.Copy(&buf, stdout)
}()
_, _ = io.Copy(&buf, stdout)

// Wait() will wait for us to finish draining stderr before returning the exit code
err = c.Wait()
Expand Down

0 comments on commit a58a5d5

Please sign in to comment.