iop/apps/node/internal/transport/session_test.go
toki 96f79fcd08 feat: unbounded CLI sessions support and related improvements
- Add unbounded CLI sessions agent-task with plan and code review logs
- Add edge console with tests
- Add node run manager for session lifecycle management
- Add router and store tests
- Update transport session handling
- Add runtime proto definitions
- Update configurations and packages
2026-05-03 20:07:09 +09:00

33 lines
630 B
Go

package transport_test
import (
"context"
"sync"
"testing"
"iop/apps/node/internal/transport"
iop "iop/proto/gen/iop"
)
type noopHandler struct{}
func (h *noopHandler) OnRunRequest(_ context.Context, _ *transport.Session, _ *iop.RunRequest) error {
return nil
}
func (h *noopHandler) OnCancel(_ context.Context, _ *transport.Session, _ *iop.CancelRequest) error {
return nil
}
func TestSession_SetHandler_ConcurrentSafe(t *testing.T) {
var s transport.Session
var wg sync.WaitGroup
h := &noopHandler{}
for i := 0; i < 50; i++ {
wg.Add(1)
go func() {
defer wg.Done()
s.SetHandler(h)
}()
}
wg.Wait()
}