gopls/internal/regtest: fix race when printing regtest state on falure

Change-Id: Ia4d36510d5929789f045480a22e4e6c20d3c96c5
Reviewed-on: https://go-review.googlesource.com/c/tools/+/302289
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
This commit is contained in:
Rob Findley 2021-03-16 14:09:21 -04:00 committed by Robert Findley
parent 6d45e3d999
commit 9e9211a98e
1 changed files with 2 additions and 1 deletions

View File

@ -282,8 +282,9 @@ func (e *Env) Await(expectations ...Expectation) {
e.mu.Unlock()
return
case Unmeetable:
failure := fmt.Sprintf("unmeetable expectations:\n%s\nstate:\n%v", summary, e.state)
e.mu.Unlock()
e.T.Fatalf("unmeetable expectations:\n%s\nstate:\n%v", summary, e.state)
e.T.Fatal(failure)
}
cond := &condition{
expectations: expectations,