-
Notifications
You must be signed in to change notification settings - Fork 55
fix: inherit configuration in run_parallel
#215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -649,7 +649,8 @@ impl<D: AsyncDB, M: MakeConnection<Conn = D>> Runner<D, M> { | |
}; | ||
|
||
if is_background { | ||
// Spawn a new process, but don't wait for stdout, otherwise it will block until the process exits. | ||
// Spawn a new process, but don't wait for stdout, otherwise it will block until | ||
// the process exits. | ||
let error: Option<AnyError> = match cmd.spawn() { | ||
Ok(_) => None, | ||
Err(e) => Some(Arc::new(e)), | ||
|
@@ -1090,6 +1091,9 @@ impl<D: AsyncDB, M: MakeConnection<Conn = D>> Runner<D, M> { | |
|
||
/// accept the tasks, spawn jobs task to run slt test. the tasks are (AsyncDB, slt filename) | ||
/// pairs. | ||
// TODO: This is not a good interface, as the `make_conn` passed to `new` is unused but we | ||
// accept a new `conn_builder` here. May change `MakeConnection` to support specifying the | ||
// database name in the future. | ||
Comment on lines
+1094
to
+1096
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand the comment here. Where's the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, do you mean There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, so it seems There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The idea of
|
||
pub async fn run_parallel_async<Fut>( | ||
&mut self, | ||
glob: &str, | ||
|
@@ -1115,9 +1119,20 @@ impl<D: AsyncDB, M: MakeConnection<Conn = D>> Runner<D, M> { | |
.await | ||
.expect("create db failed"); | ||
let target = hosts[idx % hosts.len()].clone(); | ||
|
||
let mut tester = Runner { | ||
conn: Connections::new(move || { | ||
conn_builder(target.clone(), db_name.clone()).map(Ok) | ||
}), | ||
validator: self.validator, | ||
column_type_validator: self.column_type_validator, | ||
substitution: self.substitution.clone(), | ||
sort_mode: self.sort_mode, | ||
hash_threshold: self.hash_threshold, | ||
labels: self.labels.clone(), | ||
}; | ||
|
||
tasks.push(async move { | ||
let mut tester = | ||
Runner::new(move || conn_builder(target.clone(), db_name.clone()).map(Ok)); | ||
let filename = file.to_string_lossy().to_string(); | ||
tester.run_file_async(filename).await | ||
}) | ||
|
Uh oh!
There was an error while loading. Please reload this page.