mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
Fix "context canceled" with partial
Make sure the context used for timeouts isn't created based on the incoming context, as we have cases where this can cancel the context prematurely. Fixes #10789
This commit is contained in:
@@ -126,12 +126,6 @@ func TestInitAddWithTimeoutTimeout(t *testing.T) {
|
||||
|
||||
init := New().AddWithTimeout(100*time.Millisecond, func(ctx context.Context) (any, error) {
|
||||
time.Sleep(500 * time.Millisecond)
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return nil, nil
|
||||
default:
|
||||
}
|
||||
t.Fatal("slept")
|
||||
return nil, nil
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user