Skip to content

Commit 1e9999a

Browse files
committed
cmd/screentest: remove special case for same URL
The special case added in a previous CL is not the problem. In general, waiting for components to render is a better solution. Change-Id: Iadecccea7862db0cbfcfc525392b8859b78dda6d Reviewed-on: https://go-review.googlesource.com/c/website/+/628055 Reviewed-by: Hyang-Ah Hana Kim <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent ea85ca2 commit 1e9999a

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

cmd/golangorg/testdata/screentest/relnotes.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,8 @@ capture fullscreen
77
{{range ints 1 22}}
88
test rl{{.}}
99
path /doc/go1.{{.}}
10+
# dd.indent is added by one of the last bits of JS to run on the page:
11+
# generateTOC in https://go.dev/js/godocs.js.
12+
wait dd.indent
1013
capture fullscreen
1114
{{end}}

cmd/screentest/screentest.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ package main
1313
import (
1414
"bufio"
1515
"bytes"
16-
"cmp"
1716
"context"
1817
"errors"
1918
"fmt"
@@ -485,17 +484,6 @@ func (tc *testcase) run(ctx context.Context, update bool) (err error) {
485484
fmt.Fprintf(&tc.output, "test %s ", tc.name)
486485
var testScreen, wantScreen image.Image
487486
g, ctx := errgroup.WithContext(ctx)
488-
// If the hosts are the same, chrome (or chromedp) does not handle concurrent requests well.
489-
// This wouldn't make sense in an actual test, but it does happen in this package's tests.
490-
urla, erra := url.Parse(tc.testURL)
491-
urlb, errb := url.Parse(tc.wantURL)
492-
if err := cmp.Or(erra, errb); err != nil {
493-
return err
494-
}
495-
if urla.Host == urlb.Host {
496-
g.SetLimit(1)
497-
}
498-
499487
g.Go(func() error {
500488
testScreen, err = tc.screenshot(ctx, tc.testURL, tc.testPath, tc.testImageReader)
501489
return err

0 commit comments

Comments
 (0)