runOverflowSession drives a RunStream against a model that always returns a ContextOverflowError, returning the number of "started" compaction events observed and whether the runtime ultimately surfaced an ErrorEvent.
(t *testing.T, rt *LocalRuntime)
| 16 | // ContextOverflowError, returning the number of "started" compaction events |
| 17 | // observed and whether the runtime ultimately surfaced an ErrorEvent. |
| 18 | func runOverflowSession(t *testing.T, rt *LocalRuntime) (compactions int, sawError bool) { |
| 19 | t.Helper() |
| 20 | sess := session.New(session.WithUserMessage("Hello")) |
| 21 | for ev := range rt.RunStream(t.Context(), sess) { |
| 22 | if e, ok := ev.(*SessionCompactionEvent); ok && e.Status == "started" { |
| 23 | compactions++ |
| 24 | } |
| 25 | if _, ok := ev.(*ErrorEvent); ok { |
| 26 | sawError = true |
| 27 | } |
| 28 | } |
| 29 | return compactions, sawError |
| 30 | } |
| 31 | |
| 32 | // TestWithMaxOverflowCompactions_Zero verifies that passing 0 disables the |
| 33 | // compaction-retry path entirely: an overflow error surfaces immediately |
no test coverage detected