Skip to content

Commit 34e361c

Browse files
committed
tests: cap actix workers to prevent fd exhaustion
cargo test was failing with too many open files because each test server spawned a worker per CPU, quickly exhausting file descriptors when tests ran in parallel. Set test servers to one worker so they use a bounded number of sockets/threads, avoiding fd exhaustion and letting OIDC and migration tests start reliably.
1 parent 7d2de51 commit 34e361c

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

tests/common/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ pub fn start_echo_server(shutdown: oneshot::Receiver<()>) -> (JoinHandle<()>, u1
158158
Ok(req.into_response(resp))
159159
}))
160160
})
161+
.workers(1)
161162
.listen(listener)
162163
.unwrap()
163164
.shutdown_timeout(1)

tests/oidc/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ impl FakeOidcProvider {
201201
.route("/jwks", web::get().to(jwks_endpoint))
202202
.route("/token", web::post().to(token_endpoint))
203203
})
204+
.workers(1)
204205
.listen(listener)
205206
.unwrap()
206207
.shutdown_timeout(1)

0 commit comments

Comments
 (0)