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