marvelefe commented on code in PR #2884:
URL:
https://github.com/apache/datafusion-ballista/pull/2884#discussion_r4675953584
##########
ballista/core/src/execution_plans/distributed_query.rs:
##########
@@ -1958,4 +2058,133 @@ mod test {
"unexpected error: {err}"
);
}
+
+ /// Runs a job through the pull or push client against a scheduler that
+ /// serves `statuses`, and returns its batches and the execution metrics.
+ async fn run_job(
+ pull: bool,
+ statuses: Vec<JobStatus>,
+ ) -> (
+
datafusion::error::Result<Vec<datafusion::arrow::record_batch::RecordBatch>>,
+ Arc<ExecutionPlanMetricsSet>,
+ ) {
+ let scheduler = FakeScheduler::compatible(statuses);
+ let url = scheduler.start().await;
+ let metrics = Arc::new(ExecutionPlanMetricsSet::new());
+ let stream = submit(pull, url, metrics.clone()).await;
+ let batches = match stream {
+ Ok(stream) => stream.try_collect().await,
+ Err(e) => Err(e),
+ };
+ (batches, metrics)
+ }
+
+ fn gauge(metrics: &ExecutionPlanMetricsSet, name: &str) -> Option<usize> {
+ metrics
+ .clone_inner()
+ .iter()
+ .find_map(|metric| match metric.value() {
+ MetricValue::Gauge { name: n, gauge } if n == name =>
Some(gauge.value()),
+ _ => None,
+ })
+ }
+
+ #[tokio::test]
+ async fn pull_and_push_finish_a_successful_job_with_timing_metrics() {
Review Comment:
@andygrove I'm leaning towards leaving this one out for now. Exercising
`fetch_partition` needs a fake executor serving Flight data, which is more
machinery than this PR needs. The `ballista` client integration tests already
run the fetch path end to end.
I'm happy to add it as a follow-up if you'd prefer - let me know what you
think, and I'll create the issue
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]