@@ -188,7 +188,7 @@ mod tests {
188188 StorableEvent :: test_default ( event_id)
189189 }
190190
191- #[ tokio:: test]
191+ #[ tokio:: test( flavor = "multi_thread" , worker_threads = 2 ) ]
192192 async fn spawn_and_send_event ( ) {
193193 let pool = test_pool ( ) . await ;
194194 let ( handle, _join) = spawn ( pool. clone ( ) , None , None , test_stats ( ) ) . await . unwrap ( ) ;
@@ -204,7 +204,7 @@ mod tests {
204204 assert_eq ! ( event. unwrap( ) . title. as_deref( ) , Some ( "test" ) ) ;
205205 }
206206
207- #[ tokio:: test]
207+ #[ tokio:: test( flavor = "multi_thread" , worker_threads = 2 ) ]
208208 async fn spawn_and_send_event_with_attachment ( ) {
209209 let pool = test_pool ( ) . await ;
210210 let ( handle, _join) = spawn ( pool. clone ( ) , None , None , test_stats ( ) ) . await . unwrap ( ) ;
@@ -232,7 +232,7 @@ mod tests {
232232 assert_eq ! ( row. 0 , 1 ) ;
233233 }
234234
235- #[ tokio:: test]
235+ #[ tokio:: test( flavor = "multi_thread" , worker_threads = 2 ) ]
236236 async fn batch_flushing_multiple_events ( ) {
237237 let pool = test_pool ( ) . await ;
238238 let ( handle, _join) = spawn ( pool. clone ( ) , None , None , test_stats ( ) ) . await . unwrap ( ) ;
@@ -251,15 +251,15 @@ mod tests {
251251 assert_eq ! ( row. 0 , 10 ) ;
252252 }
253253
254- #[ tokio:: test]
254+ #[ tokio:: test( flavor = "multi_thread" , worker_threads = 2 ) ]
255255 async fn shutdown_without_events ( ) {
256256 let pool = test_pool ( ) . await ;
257257 let ( handle, _join) = spawn ( pool. clone ( ) , None , None , test_stats ( ) ) . await . unwrap ( ) ;
258258 let _ = handle. shutdown ( ) ;
259259 tokio:: time:: sleep ( std:: time:: Duration :: from_millis ( 100 ) ) . await ;
260260 }
261261
262- #[ tokio:: test]
262+ #[ tokio:: test( flavor = "multi_thread" , worker_threads = 2 ) ]
263263 async fn insert_event_with_fingerprint_creates_issue ( ) {
264264 let pool = test_pool ( ) . await ;
265265 let ( handle, _join) = spawn ( pool. clone ( ) , None , None , test_stats ( ) ) . await . unwrap ( ) ;
@@ -280,7 +280,7 @@ mod tests {
280280 assert_eq ! ( row. 0 , 1 ) ;
281281 }
282282
283- #[ tokio:: test]
283+ #[ tokio:: test( flavor = "multi_thread" , worker_threads = 2 ) ]
284284 async fn duplicate_event_does_not_increment_issue_count ( ) {
285285 let pool = test_pool ( ) . await ;
286286
@@ -305,7 +305,7 @@ mod tests {
305305 assert_eq ! ( row. 0 , 1 ) ;
306306 }
307307
308- #[ tokio:: test]
308+ #[ tokio:: test( flavor = "multi_thread" , worker_threads = 2 ) ]
309309 async fn two_events_same_fingerprint_increments_count ( ) {
310310 let pool = test_pool ( ) . await ;
311311
@@ -341,7 +341,7 @@ mod tests {
341341 assert_eq ! ( last_seen, 200 ) ;
342342 }
343343
344- #[ tokio:: test]
344+ #[ tokio:: test( flavor = "multi_thread" , worker_threads = 2 ) ]
345345 async fn resolved_issue_reopens_on_new_event ( ) {
346346 let pool = test_pool ( ) . await ;
347347
@@ -374,7 +374,7 @@ mod tests {
374374 assert_eq ! ( row. 0 , "unresolved" ) ;
375375 }
376376
377- #[ tokio:: test]
377+ #[ tokio:: test( flavor = "multi_thread" , worker_threads = 2 ) ]
378378 async fn deferred_flush_batches_tags ( ) {
379379 let pool = test_pool ( ) . await ;
380380
@@ -418,7 +418,7 @@ mod tests {
418418 /// Regression test for the accumulate-then-clear race: when `should_agg=true`,
419419 /// events in the current batch must be accumulated *before* the aggregation
420420 /// flush runs, so every fingerprint gets a matching issue row.
421- #[ tokio:: test]
421+ #[ tokio:: test( flavor = "multi_thread" , worker_threads = 2 ) ]
422422 async fn flush_batch_with_agg_creates_issue_for_all_events ( ) {
423423 let pool = test_pool ( ) . await ;
424424 let mut acc = Accumulators :: new ( ) ;
@@ -463,7 +463,7 @@ mod tests {
463463 assert_eq ! ( row. 0 , 1 , "batch-2 fingerprint must have an issue row" ) ;
464464 }
465465
466- #[ tokio:: test]
466+ #[ tokio:: test( flavor = "multi_thread" , worker_threads = 2 ) ]
467467 async fn deferred_flush_merges_hll ( ) {
468468 let pool = test_pool ( ) . await ;
469469
@@ -496,7 +496,7 @@ mod tests {
496496
497497 /// The periodic timer should flush accumulated issue deltas to the DB
498498 /// even when no new events arrive -- without needing a shutdown.
499- #[ tokio:: test]
499+ #[ tokio:: test( flavor = "multi_thread" , worker_threads = 2 ) ]
500500 async fn periodic_timer_flushes_issues_without_new_events ( ) {
501501 let pool = test_pool ( ) . await ;
502502 let ( handle, _join) = spawn ( pool. clone ( ) , None , None , test_stats ( ) ) . await . unwrap ( ) ;
@@ -532,7 +532,7 @@ mod tests {
532532
533533 /// Multiple fingerprints accumulated in a single batch should all get
534534 /// flushed together when the periodic timer fires.
535- #[ tokio:: test]
535+ #[ tokio:: test( flavor = "multi_thread" , worker_threads = 2 ) ]
536536 async fn periodic_timer_flushes_multiple_fingerprints ( ) {
537537 let pool = test_pool ( ) . await ;
538538 let ( handle, _join) = spawn ( pool. clone ( ) , None , None , test_stats ( ) ) . await . unwrap ( ) ;
@@ -559,7 +559,7 @@ mod tests {
559559
560560 /// Same fingerprint across two timer cycles: event_count should
561561 /// correctly increment, not reset or double-count.
562- #[ tokio:: test]
562+ #[ tokio:: test( flavor = "multi_thread" , worker_threads = 2 ) ]
563563 async fn periodic_timer_same_fingerprint_across_cycles ( ) {
564564 let pool = test_pool ( ) . await ;
565565 let ( handle, _join) = spawn ( pool. clone ( ) , None , None , test_stats ( ) ) . await . unwrap ( ) ;
@@ -609,7 +609,7 @@ mod tests {
609609
610610 /// Tags and HLL data should be flushed by the periodic timer,
611611 /// not just issue rows.
612- #[ tokio:: test]
612+ #[ tokio:: test( flavor = "multi_thread" , worker_threads = 2 ) ]
613613 async fn periodic_timer_flushes_tags_and_hll ( ) {
614614 let pool = test_pool ( ) . await ;
615615 let ( handle, _join) = spawn ( pool. clone ( ) , None , None , test_stats ( ) ) . await . unwrap ( ) ;
@@ -654,7 +654,7 @@ mod tests {
654654
655655 /// After a periodic flush, new events for fresh fingerprints should
656656 /// accumulate and flush correctly on the next cycle.
657- #[ tokio:: test]
657+ #[ tokio:: test( flavor = "multi_thread" , worker_threads = 2 ) ]
658658 async fn periodic_timer_handles_subsequent_events ( ) {
659659 let pool = test_pool ( ) . await ;
660660 let ( handle, _join) = spawn ( pool. clone ( ) , None , None , test_stats ( ) ) . await . unwrap ( ) ;
@@ -703,7 +703,7 @@ mod tests {
703703 }
704704
705705 /// The periodic timer should be a no-op when there's nothing accumulated.
706- #[ tokio:: test]
706+ #[ tokio:: test( flavor = "multi_thread" , worker_threads = 2 ) ]
707707 async fn periodic_timer_noop_when_empty ( ) {
708708 let pool = test_pool ( ) . await ;
709709 let ( handle, _join) = spawn ( pool. clone ( ) , None , None , test_stats ( ) ) . await . unwrap ( ) ;
@@ -725,7 +725,7 @@ mod tests {
725725 /// Events arriving right as the timer would fire should not lose data.
726726 /// The biased select prioritizes rx.recv(), so events get batched first;
727727 /// accumulated deltas from the batch flush via the next timer tick.
728- #[ tokio:: test]
728+ #[ tokio:: test( flavor = "multi_thread" , worker_threads = 2 ) ]
729729 async fn periodic_timer_events_near_tick_boundary ( ) {
730730 let pool = test_pool ( ) . await ;
731731 let ( handle, _join) = spawn ( pool. clone ( ) , None , None , test_stats ( ) ) . await . unwrap ( ) ;
0 commit comments