@@ -559,6 +559,7 @@ func Test_shardTableClients(t *testing.T) {
559559 expected : []tableClient {
560560 {client : & testExecutionClient {}, table : & schema.Table {Name : "table_1" }},
561561 {client : & testExecutionClient {}, table : & schema.Table {Name : "table_2" }},
562+ {client : & testExecutionClient {}, table : & schema.Table {Name : "table_3" }},
562563 },
563564 },
564565 {
@@ -571,9 +572,52 @@ func Test_shardTableClients(t *testing.T) {
571572 {client : & testExecutionClient {}, table : & schema.Table {Name : "table_5" }},
572573 },
573574 shard : & shard {num : 2 , total : 2 },
575+ expected : []tableClient {
576+ {client : & testExecutionClient {}, table : & schema.Table {Name : "table_4" }},
577+ {client : & testExecutionClient {}, table : & schema.Table {Name : "table_5" }},
578+ },
579+ },
580+ {
581+ name : "uneven split 1 of 3" ,
582+ tableClients : []tableClient {
583+ {client : & testExecutionClient {}, table : & schema.Table {Name : "table_1" }},
584+ {client : & testExecutionClient {}, table : & schema.Table {Name : "table_2" }},
585+ {client : & testExecutionClient {}, table : & schema.Table {Name : "table_3" }},
586+ {client : & testExecutionClient {}, table : & schema.Table {Name : "table_4" }},
587+ {client : & testExecutionClient {}, table : & schema.Table {Name : "table_5" }},
588+ },
589+ shard : & shard {num : 1 , total : 3 },
590+ expected : []tableClient {
591+ {client : & testExecutionClient {}, table : & schema.Table {Name : "table_1" }},
592+ {client : & testExecutionClient {}, table : & schema.Table {Name : "table_2" }},
593+ },
594+ },
595+ {
596+ name : "uneven split 2 of 3" ,
597+ tableClients : []tableClient {
598+ {client : & testExecutionClient {}, table : & schema.Table {Name : "table_1" }},
599+ {client : & testExecutionClient {}, table : & schema.Table {Name : "table_2" }},
600+ {client : & testExecutionClient {}, table : & schema.Table {Name : "table_3" }},
601+ {client : & testExecutionClient {}, table : & schema.Table {Name : "table_4" }},
602+ {client : & testExecutionClient {}, table : & schema.Table {Name : "table_5" }},
603+ },
604+ shard : & shard {num : 2 , total : 3 },
574605 expected : []tableClient {
575606 {client : & testExecutionClient {}, table : & schema.Table {Name : "table_3" }},
576607 {client : & testExecutionClient {}, table : & schema.Table {Name : "table_4" }},
608+ },
609+ },
610+ {
611+ name : "uneven split 3 of 3" ,
612+ tableClients : []tableClient {
613+ {client : & testExecutionClient {}, table : & schema.Table {Name : "table_1" }},
614+ {client : & testExecutionClient {}, table : & schema.Table {Name : "table_2" }},
615+ {client : & testExecutionClient {}, table : & schema.Table {Name : "table_3" }},
616+ {client : & testExecutionClient {}, table : & schema.Table {Name : "table_4" }},
617+ {client : & testExecutionClient {}, table : & schema.Table {Name : "table_5" }},
618+ },
619+ shard : & shard {num : 3 , total : 3 },
620+ expected : []tableClient {
577621 {client : & testExecutionClient {}, table : & schema.Table {Name : "table_5" }},
578622 },
579623 },
0 commit comments