Enforce continuous validation

This commit is contained in:
2026-08-10 23:08:52 +00:00
parent b89224bbde
commit feba7b9d74
16 changed files with 378 additions and 529 deletions

View File

@@ -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()