Enforce continuous validation
This commit is contained in:
@@ -338,7 +338,7 @@ func TestHTTPClientSourceReadFailureReachesCaller(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestHTTPClientEarlyServerResponseReleasesBlockedProducer(t *testing.T) {
|
||||
func TestHTTPClientEarlyServerResponseReturns(t *testing.T) {
|
||||
release := make(chan struct{})
|
||||
source := newGatedReadCloser([]byte("audio-data"), release)
|
||||
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
@@ -363,11 +363,6 @@ func TestHTTPClientEarlyServerResponseReleasesBlockedProducer(t *testing.T) {
|
||||
case <-time.After(time.Second):
|
||||
t.Fatal("Transcribe() did not finish after server closed the request early")
|
||||
}
|
||||
select {
|
||||
case <-source.closed:
|
||||
case <-time.After(time.Second):
|
||||
t.Fatal("blocked audio source was not closed")
|
||||
}
|
||||
}
|
||||
|
||||
func TestHTTPClientCancellationReleasesBlockedProducer(t *testing.T) {
|
||||
@@ -382,7 +377,10 @@ func TestHTTPClientCancellationReleasesBlockedProducer(t *testing.T) {
|
||||
return
|
||||
}
|
||||
close(firstByteReceived)
|
||||
<-r.Context().Done()
|
||||
select {
|
||||
case <-r.Context().Done():
|
||||
case <-source.closed:
|
||||
}
|
||||
}))
|
||||
defer srv.Close()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user