eliminate test harness and SSE race conditions

This commit is contained in:
kami
2026-07-26 20:51:58 +04:00
parent 076c3de6dd
commit 325c684eb0
2 changed files with 16 additions and 9 deletions
+2 -2
View File
@@ -10,6 +10,7 @@ import (
"orchestra/internal/store"
"strings"
"testing"
"time"
)
func TestReadinessRequiresRouterAndReturnsJSON(t *testing.T) {
@@ -82,8 +83,7 @@ func TestSubscribeEmitsCursorAndEvent(t *testing.T) {
w := httptest.NewRecorder()
done := make(chan struct{})
go func() { h(w, r); close(done) }()
for !strings.Contains(w.Body.String(), "id: 1") {
}
time.Sleep(150 * time.Millisecond)
cancel()
<-done
if !strings.Contains(w.Body.String(), "id: 1") {