@@ -181,7 +181,7 @@ func newTestStoreWithOpts(t *testing.T, opts Options) (*Store, func()) {
181181func TestBunStore_sqlMetaCache_appendTranscriptStaleUntilTTL (t * testing.T ) {
182182 t .Parallel ()
183183 ctx := context .Background ()
184- st , cleanup := newTestStoreWithOpts (t , Options {SQLQueryCacheTTL : 120 * time .Millisecond , SQLQueryCacheMaxEntries : 64 })
184+ st , cleanup := newTestStoreWithOpts (t , Options {SQLQueryCacheTTL : 50 * time .Millisecond , SQLQueryCacheMaxEntries : 64 })
185185 defer cleanup ()
186186 fp := domain.TokenFingerprint {}
187187 fp [0 ] = 1
@@ -211,18 +211,19 @@ func TestBunStore_sqlMetaCache_appendTranscriptStaleUntilTTL(t *testing.T) {
211211 }); err != nil {
212212 t .Fatalf ("expected cached policy before TTL: %v" , err )
213213 }
214- time .Sleep (150 * time .Millisecond )
215- if err := st .AppendTranscript (ctx , domain.TranscriptItem {
214+ time .Sleep (500 * time .Millisecond )
215+ err := st .AppendTranscript (ctx , domain.TranscriptItem {
216216 SessionID : cr .SessionID , TurnID : "t1" , EventKind : "e3" , PayloadRef : "p3" , CreatedAt : time .Unix (4 , 0 ),
217- }); err != domain .ErrTranscriptDisabled {
217+ })
218+ if ! errors .Is (err , domain .ErrTranscriptDisabled ) {
218219 t .Fatalf ("want ErrTranscriptDisabled after TTL got %v" , err )
219220 }
220221}
221222
222223func TestBunStore_sqlMetaCache_transcriptObservesStalePolicyUntilTTL (t * testing.T ) {
223224 t .Parallel ()
224225 ctx := context .Background ()
225- st , cleanup := newTestStoreWithOpts (t , Options {SQLQueryCacheTTL : 120 * time .Millisecond , SQLQueryCacheMaxEntries : 64 })
226+ st , cleanup := newTestStoreWithOpts (t , Options {SQLQueryCacheTTL : 50 * time .Millisecond , SQLQueryCacheMaxEntries : 64 })
226227 defer cleanup ()
227228
228229 fp := domain.TokenFingerprint {}
@@ -258,7 +259,7 @@ func TestBunStore_sqlMetaCache_transcriptObservesStalePolicyUntilTTL(t *testing.
258259 if len (items ) != 1 {
259260 t .Fatalf ("want stale read to still return transcript rows got len=%d" , len (items ))
260261 }
261- time .Sleep (150 * time .Millisecond )
262+ time .Sleep (500 * time .Millisecond )
262263 items2 , err := st .Transcript (ctx , cr .SessionID , domain.ReadOptions {})
263264 if err != nil {
264265 t .Fatal (err )
0 commit comments