Skip to content

Commit df8f818

Browse files
authored
chore: Avoid build fails on MinIO rate limits (#20472)
## Which issue does this PR close? <!-- We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123. --> - Closes #. ## Rationale for this change Sometimes CI failed because of docker rates limits. ``` thread 'test_s3_url_fallback' (11052) panicked at datafusion-cli/tests/cli_integration.rs:116:13: Failed to start MinIO container. Ensure Docker is running and accessible: failed to pull the image 'minio/minio:RELEASE.2025-02-28T09-55-16Z', error: Docker responded with status code 500: toomanyrequests: You have reached your unauthenticated pull rate limit. https://www.docker.com/increase-rate-limit stack backtrace: ``` Example https://github.com/apache/datafusion/actions/runs/22262073722/job/64401977127 <!-- Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed. Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes. --> ## What changes are included in this PR? Ignore the tests if rates limit hit only <!-- There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR. --> ## Are these changes tested? <!-- We typically require tests for all PRs in order to: 1. Prevent the code from being accidentally broken by subsequent changes 2. Serve as another way to document the expected behavior of the code If tests are not included in your PR, please explain why (for example, are they covered by existing tests)? --> ## Are there any user-facing changes? <!-- If there are user-facing changes then we may require documentation to be updated before approving the PR. --> <!-- If there are any breaking changes to public APIs, please add the `api change` label. -->
1 parent ed0323a commit df8f818

1 file changed

Lines changed: 40 additions & 17 deletions

File tree

datafusion-cli/tests/cli_integration.rs

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ fn make_settings() -> Settings {
4444
settings
4545
}
4646

47-
async fn setup_minio_container() -> ContainerAsync<minio::MinIO> {
47+
async fn setup_minio_container() -> Result<ContainerAsync<minio::MinIO>, String> {
4848
const MINIO_ROOT_USER: &str = "TEST-DataFusionLogin";
4949
const MINIO_ROOT_PASSWORD: &str = "TEST-DataFusionPassword";
5050

@@ -99,27 +99,23 @@ async fn setup_minio_container() -> ContainerAsync<minio::MinIO> {
9999
let stdout = container.stdout_to_vec().await.unwrap_or_default();
100100
let stderr = container.stderr_to_vec().await.unwrap_or_default();
101101

102-
panic!(
102+
return Err(format!(
103103
"Failed to execute command: {}\nError: {}\nStdout: {:?}\nStderr: {:?}",
104104
cmd_ref,
105105
e,
106106
String::from_utf8_lossy(&stdout),
107107
String::from_utf8_lossy(&stderr)
108-
);
108+
));
109109
}
110110
}
111111

112-
container
112+
Ok(container)
113113
}
114114

115-
Err(TestcontainersError::Client(e)) => {
116-
panic!(
117-
"Failed to start MinIO container. Ensure Docker is running and accessible: {e}"
118-
);
119-
}
120-
Err(e) => {
121-
panic!("Failed to start MinIO container: {e}");
122-
}
115+
Err(TestcontainersError::Client(e)) => Err(format!(
116+
"Failed to start MinIO container. Ensure Docker is running and accessible: {e}"
117+
)),
118+
Err(e) => Err(format!("Failed to start MinIO container: {e}")),
123119
}
124120
}
125121

@@ -253,7 +249,14 @@ async fn test_cli() {
253249
return;
254250
}
255251

256-
let container = setup_minio_container().await;
252+
let container = match setup_minio_container().await {
253+
Ok(c) => c,
254+
Err(e) if e.contains("toomanyrequests") => {
255+
eprintln!("Skipping test: Docker pull rate limit reached: {e}");
256+
return;
257+
}
258+
e @ Err(_) => e.unwrap(),
259+
};
257260

258261
let settings = make_settings();
259262
let _bound = settings.bind_to_scope();
@@ -286,7 +289,14 @@ async fn test_aws_options() {
286289
let settings = make_settings();
287290
let _bound = settings.bind_to_scope();
288291

289-
let container = setup_minio_container().await;
292+
let container = match setup_minio_container().await {
293+
Ok(c) => c,
294+
Err(e) if e.contains("toomanyrequests") => {
295+
eprintln!("Skipping test: Docker pull rate limit reached: {e}");
296+
return;
297+
}
298+
e @ Err(_) => e.unwrap(),
299+
};
290300
let port = container.get_host_port_ipv4(9000).await.unwrap();
291301

292302
let input = format!(
@@ -377,7 +387,14 @@ async fn test_s3_url_fallback() {
377387
return;
378388
}
379389

380-
let container = setup_minio_container().await;
390+
let container = match setup_minio_container().await {
391+
Ok(c) => c,
392+
Err(e) if e.contains("toomanyrequests") => {
393+
eprintln!("Skipping test: Docker pull rate limit reached: {e}");
394+
return;
395+
}
396+
e @ Err(_) => e.unwrap(),
397+
};
381398

382399
let mut settings = make_settings();
383400
settings.set_snapshot_suffix("s3_url_fallback");
@@ -407,8 +424,14 @@ async fn test_object_store_profiling() {
407424
return;
408425
}
409426

410-
let container = setup_minio_container().await;
411-
427+
let container = match setup_minio_container().await {
428+
Ok(c) => c,
429+
Err(e) if e.contains("toomanyrequests") => {
430+
eprintln!("Skipping test: Docker pull rate limit reached: {e}");
431+
return;
432+
}
433+
e @ Err(_) => e.unwrap(),
434+
};
412435
let mut settings = make_settings();
413436

414437
// as the object store profiling contains timestamps and durations, we must

0 commit comments

Comments
 (0)