Skip to content

Commit f0012b4

Browse files
committed
editoast: add Deadlocks comment
1 parent 4797493 commit f0012b4

File tree

5 files changed

+14
-0
lines changed

5 files changed

+14
-0
lines changed

editoast/editoast_models/src/db_connection_pool.rs

+8
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,14 @@ impl DbConnectionPoolV2 {
134134
/// # }
135135
/// ```
136136
///
137+
/// ### Deadlocks
138+
///
139+
/// We encountered a deadlock error in our tests,
140+
/// especially those using `empty_infra`` and `small_infra``.
141+
/// Adding `#[serial_test::serial]` solved the issue.
142+
/// We tried increasing the deadlock timeout, but that didn't work.
143+
/// Using random `infra_id` with rand didn't help either.
144+
///
137145
/// ## Guidelines
138146
///
139147
/// To prevent these issues, prefer the following patterns:

editoast/src/generated_data/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ pub mod tests {
173173
use editoast_models::DbConnectionPoolV2;
174174

175175
#[rstest] // Slow test
176+
/// For more details, see `DbConnectionPoolV2::get`, Deadlocks section.
176177
#[serial_test::serial]
177178
async fn refresh_all_test() {
178179
let db_pool = DbConnectionPoolV2::for_tests();

editoast/src/modelsv2/infra.rs

+1
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ pub mod tests {
334334
}
335335

336336
#[rstest]
337+
/// For more details, see `DbConnectionPoolV2::get`, Deadlocks section.
337338
#[serial_test::serial]
338339
async fn clone_infra_with_new_name_returns_new_cloned_infra() {
339340
// GIVEN

editoast/src/views/infra/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -884,6 +884,8 @@ pub mod tests {
884884
}
885885

886886
#[rstest] // Slow test
887+
/// For more details, see `DbConnectionPoolV2::get`, Deadlocks section.
888+
#[serial_test::serial]
887889
async fn infra_refresh_force() {
888890
let app = TestAppBuilder::default_app();
889891
let db_pool = app.db_pool();

editoast/src/views/infra/railjson.rs

+2
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ mod tests {
196196
use editoast_schemas::infra::SwitchType;
197197

198198
#[rstest]
199+
/// For more details, see `DbConnectionPoolV2::get`, Deadlocks section.
199200
#[serial_test::serial]
200201
async fn test_get_railjson() {
201202
let app = TestAppBuilder::default_app();
@@ -221,6 +222,7 @@ mod tests {
221222
}
222223

223224
#[rstest]
225+
/// For more details, see `DbConnectionPoolV2::get`, Deadlocks section.
224226
#[serial_test::serial]
225227
async fn test_post_railjson() {
226228
let app = TestAppBuilder::default_app();

0 commit comments

Comments
 (0)