Skip to content

Commit 329fac7

Browse files
committed
cleanup
1 parent ef07ad4 commit 329fac7

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

dbos/conductor_test.go

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,13 @@ func (m *mockWebSocketServer) handleWebSocket(w http.ResponseWriter, r *http.Req
8585
}()
8686

8787
// Handle connection lifecycle - this function owns all I/O on conn
88-
fmt.Println("WebSocket connection established")
89-
defer fmt.Println("WebSocket connection handler exiting")
9088

9189
// We need to handle pings manually since we can't use the ping handler
9290
// (it would cause concurrent writes with our main loop)
9391
pingReceived := make(chan struct{}, 10)
9492

9593
// Custom ping handler that just signals - no writing
9694
conn.SetPingHandler(func(string) error {
97-
fmt.Println("received ping")
9895
select {
9996
case m.pings <- struct{}{}:
10097
default:
@@ -165,22 +162,11 @@ func (m *mockWebSocketServer) getURL() string {
165162
func (m *mockWebSocketServer) close() {
166163
m.closed.Store(true)
167164

168-
// Signal handler to stop
165+
// Signal handler to stop but don't block
169166
select {
170167
case m.stopHandler <- struct{}{}:
171168
default:
172169
}
173-
174-
// Connection will be closed by the handler when it receives stop signal
175-
// We just need to clear our reference after a brief delay
176-
go func() {
177-
time.Sleep(100 * time.Millisecond)
178-
m.connMu.Lock()
179-
if m.conn != nil {
180-
m.conn = nil // Just clear reference, handler already closed
181-
}
182-
m.connMu.Unlock()
183-
}()
184170
}
185171

186172
func (m *mockWebSocketServer) shutdown() {

0 commit comments

Comments
 (0)