Skip to content

Commit e930520

Browse files
committed
test(policy-server): Run proxy tests serially
This way they don't compete for docker resources on CI. Signed-off-by: Víctor Cuadrado Juan <vcuadradojuan@suse.de>
1 parent 4174d7d commit e930520

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/policy-server/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ tokio-stream = "0.1.18"
6767

6868
[dev-dependencies]
6969
backon = { version = "1.6", features = ["tokio-sleep"] }
70+
serial_test = "3"
7071
http-body-util = "0.1.3"
7172
mockall = "0.14"
7273
rcgen = { version = "0.14", features = ["crypto"] }

crates/policy-server/tests/integration_test.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,8 +1305,6 @@ fn build_request_client(
13051305

13061306
// helper functions for testing proxy functionality
13071307
mod proxy_helpers {
1308-
use std::time::Duration;
1309-
13101308
use backon::{ConstantBuilder, Retryable};
13111309
use testcontainers::{
13121310
ContainerAsync, GenericImage,
@@ -1348,8 +1346,8 @@ mod proxy_helpers {
13481346
check
13491347
.retry(
13501348
ConstantBuilder::default()
1351-
.with_delay(std::time::Duration::from_millis(100))
1352-
.with_max_times(5),
1349+
.with_delay(std::time::Duration::from_millis(500))
1350+
.with_max_times(20),
13531351
)
13541352
.await
13551353
.is_ok()
@@ -1359,6 +1357,7 @@ mod proxy_helpers {
13591357
#[rstest]
13601358
#[case::both_http_and_https_proxy(true)]
13611359
#[case::https_proxy_only(false)]
1360+
#[serial_test::serial]
13621361
#[tokio::test]
13631362
async fn test_policy_server_with_https_proxy(#[case] set_http_proxy: bool) {
13641363
use proxy_helpers::*;
@@ -1415,6 +1414,7 @@ async fn test_policy_server_with_https_proxy(#[case] set_http_proxy: bool) {
14151414
/// source. The policy is first fetched from ghcr.io, pushed to the local registry, then the policy
14161415
/// server is started with HTTP_PROXY pointing at tinyproxy. Both containers share the default
14171416
/// docker bridge network so the proxy can forward requests to the registry by its bridge IP.
1417+
#[serial_test::serial]
14181418
#[tokio::test]
14191419
async fn test_policy_server_with_http_proxy() {
14201420
use proxy_helpers::*;
@@ -1518,6 +1518,7 @@ async fn test_policy_server_with_http_proxy() {
15181518
/// A real tinyproxy is started and set as HTTPS_PROXY. With NO_PROXY=ghcr.io the policy server
15191519
/// must connect directly to ghcr.io, so startup and validation succeed and the proxy logs must not
15201520
/// contain any reference to ghcr.io.
1521+
#[serial_test::serial]
15211522
#[tokio::test]
15221523
async fn test_policy_server_with_no_proxy() {
15231524
use proxy_helpers::*;

0 commit comments

Comments
 (0)