Completed worker session tests.

This commit is contained in:
Jay
2026-04-19 10:40:23 -04:00
parent 45b1a31cbb
commit 0715bde29d
3 changed files with 309 additions and 4 deletions
+6 -3
View File
@@ -17,8 +17,8 @@ func setupWorkerTestConnection(t *testing.T) (
) {
t.Helper()
incomingData = make(chan honeybeetest.MockIncomingData, 100)
outgoingData = make(chan honeybeetest.MockOutgoingData, 100)
incomingData = make(chan honeybeetest.MockIncomingData, 10)
outgoingData = make(chan honeybeetest.MockOutgoingData, 10)
mockSocket = honeybeetest.NewMockSocket()
mockSocket.CloseFunc = func() error {
@@ -28,7 +28,10 @@ func setupWorkerTestConnection(t *testing.T) (
mockSocket.ReadMessageFunc = func() (int, []byte, error) {
select {
case data := <-incomingData:
case data, ok := <-incomingData:
if !ok {
return 0, nil, io.EOF
}
return data.MsgType, data.Data, data.Err
case <-mockSocket.Closed:
return 0, nil, io.EOF