Skip to content

Commit

Permalink
pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
alixander committed Nov 7, 2023
1 parent adb59ec commit c54ea05
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions e2etests-cli/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ layers: {
watchURL := waitLogs(ctx, stderr, urlRE)

if watchURL == "" {
t.Error(errors.New(string(stderr.Bytes())))
t.Error(errors.New(stderr.String()))
}
stderr.Reset()

Expand Down Expand Up @@ -634,7 +634,7 @@ layers: {
watchURL := waitLogs(ctx, stderr, urlRE)

if watchURL == "" {
t.Error(errors.New(string(stderr.Bytes())))
t.Error(errors.New(stderr.String()))
}
stderr.Reset()

Expand Down Expand Up @@ -688,7 +688,7 @@ layers: {
watchURL := waitLogs(ctx, stderr, urlRE)

if watchURL == "" {
t.Error(errors.New(string(stderr.Bytes())))
t.Error(errors.New(stderr.String()))
}
stderr.Reset()

Expand Down Expand Up @@ -812,11 +812,12 @@ func getNumBoards(svg string) int {

func waitLogs(ctx context.Context, buf *bytes.Buffer, pattern *regexp.Regexp) string {
ticker := time.NewTicker(10 * time.Millisecond)
defer ticker.Stop()
var match string
for i := 0; i < 100 && match == ""; i++ {
select {
case <-ticker.C:
out := string(buf.Bytes())
out := buf.String()
match = pattern.FindString(out)
case <-ctx.Done():
ticker.Stop()
Expand Down

0 comments on commit c54ea05

Please sign in to comment.