Fix flake.

This commit is contained in:
Nuno Cruces
2025-04-25 00:40:52 +01:00
parent 383f620a1e
commit b32db76da6

View File

@@ -249,8 +249,9 @@ func Test_nested_context(t *testing.T) {
cancel()
var terr interface{ Temporary() bool }
if inner.Next() || !errors.As(inner.Err(), &terr) || !terr.Temporary() {
t.Fatalf("got %v, want temporary", inner.Err())
if inner.Next() || !errors.Is(inner.Err(), context.Canceled) &&
(!errors.As(inner.Err(), &terr) || !terr.Temporary()) {
t.Fatalf("got %v, want cancellation", inner.Err())
}
want(outer, 1)