Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
727fdb9a7d | ||
|
|
5670edb269 |
@@ -9,6 +9,7 @@ import (
|
||||
"net/http/httptest"
|
||||
"slices"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/go-chi/chi/v5/middleware"
|
||||
"sneak.berlin/go/pixa/internal/httpfetcher"
|
||||
@@ -101,8 +102,10 @@ func TestImageRoutes_ClientGoneAnswers499(t *testing.T) {
|
||||
ctx, http.MethodGet, target, nil))
|
||||
}()
|
||||
|
||||
// The fetch is still held, so the second request can end only
|
||||
// because its client went away
|
||||
// Give the second request time to start waiting for the first
|
||||
// request's image. The fetch is still held, so the second request
|
||||
// can end only because its client went away
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
cancel()
|
||||
<-secondDone
|
||||
|
||||
|
||||
Reference in New Issue
Block a user