@@ -649,7 +649,8 @@ impl<D: AsyncDB, M: MakeConnection<Conn = D>> Runner<D, M> {
649
649
} ;
650
650
651
651
if is_background {
652
- // Spawn a new process, but don't wait for stdout, otherwise it will block until the process exits.
652
+ // Spawn a new process, but don't wait for stdout, otherwise it will block until
653
+ // the process exits.
653
654
let error: Option < AnyError > = match cmd. spawn ( ) {
654
655
Ok ( _) => None ,
655
656
Err ( e) => Some ( Arc :: new ( e) ) ,
@@ -1090,6 +1091,9 @@ impl<D: AsyncDB, M: MakeConnection<Conn = D>> Runner<D, M> {
1090
1091
1091
1092
/// accept the tasks, spawn jobs task to run slt test. the tasks are (AsyncDB, slt filename)
1092
1093
/// pairs.
1094
+ // TODO: This is not a good interface, as the `make_conn` passed to `new` is unused but we
1095
+ // accept a new `conn_builder` here. May change `MakeConnection` to support specifying the
1096
+ // database name in the future.
1093
1097
pub async fn run_parallel_async < Fut > (
1094
1098
& mut self ,
1095
1099
glob : & str ,
@@ -1115,9 +1119,20 @@ impl<D: AsyncDB, M: MakeConnection<Conn = D>> Runner<D, M> {
1115
1119
. await
1116
1120
. expect ( "create db failed" ) ;
1117
1121
let target = hosts[ idx % hosts. len ( ) ] . clone ( ) ;
1122
+
1123
+ let mut tester = Runner {
1124
+ conn : Connections :: new ( move || {
1125
+ conn_builder ( target. clone ( ) , db_name. clone ( ) ) . map ( Ok )
1126
+ } ) ,
1127
+ validator : self . validator ,
1128
+ column_type_validator : self . column_type_validator ,
1129
+ substitution : self . substitution . clone ( ) ,
1130
+ sort_mode : self . sort_mode ,
1131
+ hash_threshold : self . hash_threshold ,
1132
+ labels : self . labels . clone ( ) ,
1133
+ } ;
1134
+
1118
1135
tasks. push ( async move {
1119
- let mut tester =
1120
- Runner :: new ( move || conn_builder ( target. clone ( ) , db_name. clone ( ) ) . map ( Ok ) ) ;
1121
1136
let filename = file. to_string_lossy ( ) . to_string ( ) ;
1122
1137
tester. run_file_async ( filename) . await
1123
1138
} )
0 commit comments