pr comments
This commit is contained in:
parent
adb59ec470
commit
c54ea05e27
1 changed files with 5 additions and 4 deletions
|
|
@ -578,7 +578,7 @@ layers: {
|
||||||
watchURL := waitLogs(ctx, stderr, urlRE)
|
watchURL := waitLogs(ctx, stderr, urlRE)
|
||||||
|
|
||||||
if watchURL == "" {
|
if watchURL == "" {
|
||||||
t.Error(errors.New(string(stderr.Bytes())))
|
t.Error(errors.New(stderr.String()))
|
||||||
}
|
}
|
||||||
stderr.Reset()
|
stderr.Reset()
|
||||||
|
|
||||||
|
|
@ -634,7 +634,7 @@ layers: {
|
||||||
watchURL := waitLogs(ctx, stderr, urlRE)
|
watchURL := waitLogs(ctx, stderr, urlRE)
|
||||||
|
|
||||||
if watchURL == "" {
|
if watchURL == "" {
|
||||||
t.Error(errors.New(string(stderr.Bytes())))
|
t.Error(errors.New(stderr.String()))
|
||||||
}
|
}
|
||||||
stderr.Reset()
|
stderr.Reset()
|
||||||
|
|
||||||
|
|
@ -688,7 +688,7 @@ layers: {
|
||||||
watchURL := waitLogs(ctx, stderr, urlRE)
|
watchURL := waitLogs(ctx, stderr, urlRE)
|
||||||
|
|
||||||
if watchURL == "" {
|
if watchURL == "" {
|
||||||
t.Error(errors.New(string(stderr.Bytes())))
|
t.Error(errors.New(stderr.String()))
|
||||||
}
|
}
|
||||||
stderr.Reset()
|
stderr.Reset()
|
||||||
|
|
||||||
|
|
@ -812,11 +812,12 @@ func getNumBoards(svg string) int {
|
||||||
|
|
||||||
func waitLogs(ctx context.Context, buf *bytes.Buffer, pattern *regexp.Regexp) string {
|
func waitLogs(ctx context.Context, buf *bytes.Buffer, pattern *regexp.Regexp) string {
|
||||||
ticker := time.NewTicker(10 * time.Millisecond)
|
ticker := time.NewTicker(10 * time.Millisecond)
|
||||||
|
defer ticker.Stop()
|
||||||
var match string
|
var match string
|
||||||
for i := 0; i < 100 && match == ""; i++ {
|
for i := 0; i < 100 && match == ""; i++ {
|
||||||
select {
|
select {
|
||||||
case <-ticker.C:
|
case <-ticker.C:
|
||||||
out := string(buf.Bytes())
|
out := buf.String()
|
||||||
match = pattern.FindString(out)
|
match = pattern.FindString(out)
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
ticker.Stop()
|
ticker.Stop()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue