File tree Expand file tree Collapse file tree
crates/smoketests/tests/smoketests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -343,11 +343,9 @@ fn test_add_table_columns() {
343343 // Subscribe to person table changes multiple times to simulate active clients
344344 let mut subs = Vec :: with_capacity ( NUM_SUBSCRIBERS ) ;
345345 for _ in 0 ..NUM_SUBSCRIBERS {
346- // We need unconfirmed reads for the updates to arrive properly.
347- // Otherwise, there's a race between module teardown in publish, vs subscribers
348- // getting the row deletion they expect.
346+ // The migration below should disconnect all existing subscribers.
349347 subs. push (
350- test. subscribe_background_unconfirmed ( & [ "select * from person" ] , 5 )
348+ test. subscribe_background_until_closed ( & [ "select * from person" ] )
351349 . unwrap ( ) ,
352350 ) ;
353351 }
@@ -389,9 +387,8 @@ fn test_add_table_columns() {
389387 test. call ( "add_person" , & [ "Robert2" ] ) . unwrap ( ) ;
390388
391389 // Validate all subscribers were disconnected after first upgrade
392- for ( i, sub) in subs. into_iter ( ) . enumerate ( ) {
393- let rows = sub. collect ( ) . unwrap ( ) ;
394- assert_eq ! ( rows. len( ) , 2 , "Subscriber {i} received unexpected rows: {rows:?}" ) ;
390+ for sub in subs {
391+ sub. collect ( ) . unwrap ( ) ;
395392 }
396393
397394 // Second upgrade
Original file line number Diff line number Diff line change @@ -592,7 +592,7 @@ fn test_view_primary_key_auto_migration_disconnects_clients() {
592592 . build ( ) ;
593593
594594 let sub = test
595- . subscribe_background_unconfirmed ( & [ "select * from player" ] , 2 )
595+ . subscribe_background_until_closed ( & [ "select * from player" ] )
596596 . unwrap ( ) ;
597597
598598 test. use_precompiled_module ( "views-primary-key-auto-migrate-updated" ) ;
@@ -672,7 +672,7 @@ fn test_subscribing_with_different_identities() {
672672
673673 test. new_identity ( ) . unwrap ( ) ;
674674
675- let sub = test. subscribe_background ( & [ "select * from my_player" ] , 2 ) . unwrap ( ) ;
675+ let sub = test. subscribe_background ( & [ "select * from my_player" ] , 1 ) . unwrap ( ) ;
676676 test. call ( "insert_player" , & [ "Bob" ] ) . unwrap ( ) ;
677677 let events = sub. collect ( ) . unwrap ( ) ;
678678
You can’t perform that action at this time.
0 commit comments