Skip to content

Commit 122eb95

Browse files
authored
SERVER-102614 Add a timeout to Evergreen test stats requests (#90)
1 parent ebab1b1 commit 122eb95

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# Changelog
2+
## 0.7.23 - 2025-03-17
3+
* Add a timeout to Evergreen test stats requests
4+
25
## 0.7.22 - 2025-01-22
36
* Avoid a division-by-zero when processing empty suites.
47

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "mongo-task-generator"
33
description = "Dynamically split evergreen tasks into subtasks for testing the 10gen/mongo project."
44
license = "Apache-2.0"
5-
version = "0.7.22"
5+
version = "0.7.23"
66
repository = "https://github.com/mongodb/mongo-task-generator"
77
authors = ["DevProd Correctness Team <devprod-correctness-team@mongodb.com>"]
88
edition = "2018"

src/evergreen/evg_task_history.rs

+10-4
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
33
use anyhow::{bail, Result};
44
use async_trait::async_trait;
5-
use reqwest::{Client, Error};
5+
use reqwest::Error;
66
use reqwest_middleware::{ClientBuilder, ClientWithMiddleware};
77
use reqwest_retry::policies::ExponentialBackoff;
88
use reqwest_retry::RetryTransientMiddleware;
99
use serde::Deserialize;
1010
use std::collections::HashMap;
1111
use std::fmt::{Display, Formatter};
12+
use std::time::Duration;
1213

1314
const REQWEST_CLIENT_MAX_RETRY_COUNT: u32 = 3;
1415
const HOOK_DELIMITER: char = ':';
@@ -199,9 +200,14 @@ impl TaskHistoryService for TaskHistoryServiceImpl {
199200
pub fn build_retryable_client() -> ClientWithMiddleware {
200201
let retry_policy =
201202
ExponentialBackoff::builder().build_with_max_retries(REQWEST_CLIENT_MAX_RETRY_COUNT);
202-
ClientBuilder::new(Client::new())
203-
.with(RetryTransientMiddleware::new_with_policy(retry_policy))
204-
.build()
203+
ClientBuilder::new(
204+
reqwest::Client::builder()
205+
.timeout(Duration::from_secs(30))
206+
.build()
207+
.unwrap(),
208+
)
209+
.with(RetryTransientMiddleware::new_with_policy(retry_policy))
210+
.build()
205211
}
206212

207213
/// Convert the list of stats into a map of test names to test stats.

0 commit comments

Comments
 (0)