eliminate test harness and SSE race conditions
This commit is contained in:
@@ -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") {
|
||||
|
||||
Reference in New Issue
Block a user