(t *testing.T)
| 109 | } |
| 110 | |
| 111 | func TestTimeout(t *testing.T) { |
| 112 | const ( |
| 113 | testTimeout = time.Millisecond * 50 |
| 114 | ) |
| 115 | |
| 116 | mg := NewManager(&nopLogger, nil, nil) |
| 117 | mg.timeout = testTimeout |
| 118 | ctx := context.Background() |
| 119 | sessionID := uuid.New() |
| 120 | // session manager is not running, so event loop is not running and therefore calling the APIs should timeout |
| 121 | session, err := mg.RegisterSession(ctx, sessionID, nil) |
| 122 | require.ErrorIs(t, err, context.DeadlineExceeded) |
| 123 | require.Nil(t, session) |
| 124 | |
| 125 | err = mg.UnregisterSession(ctx, sessionID, "session gone", true) |
| 126 | require.ErrorIs(t, err, context.DeadlineExceeded) |
| 127 | } |
| 128 | |
| 129 | func TestUnregisterSessionCloseSession(t *testing.T) { |
| 130 | sessionID := uuid.New() |
nothing calls this directly
no test coverage detected