Skip to content

Commit

Permalink
E2E: Add a temporary workaround for MySQL tests
Browse files Browse the repository at this point in the history
  • Loading branch information
s373r committed Aug 15, 2024
1 parent 6dc9c8a commit 3dc3df3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
14 changes: 14 additions & 0 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,25 @@
fail-fast = false

[test-groups]
mysql = { max-threads = 1 } # Explanation below
setup = { max-threads = 1 } # Serialize the setup steps
containerized = { max-threads = 8 } # Don't use too much memory
engine = { max-threads = 2 } # Engine tests are very memory-hungry
database = { max-threads = 8 } # Don't use too much memory

# TODO: Delete this workaround when this PR is merged:
# - Fix: nextest cleanup race condition by bonega
# https://github.com/launchbadge/sqlx/pull/3334
#
# NOTE: There is an incompatibility between nextest and sqlx:
# - nextest implies multiprocessing,
# - while sqlx has a lock on cleanup within the current process
# (https://github.com/launchbadge/sqlx/pull/2640#issuecomment-1659455042).
[[profile.default.overrides]]
filter = "test(::mysql::)"
test-group = "mysql"
retries = { count = 3, backoff = "exponential", delay = "3s" }

[[profile.default.overrides]]
filter = "test(::setup::)"
test-group = "setup"
Expand Down
4 changes: 1 addition & 3 deletions src/e2e/app/cli/common-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ fn kamu_cli_e2e_test_impl(harness_method: &Ident, input: TokenStream) -> TokenSt
}
},
"mysql" => quote! {
// flaky: when running in parallel, errors occur with table not found (or sporadic deadlocks),
// restarting again solves the problem.
#[test_group::group(e2e, database, mysql, flaky, #extra_test_groups)]
#[test_group::group(e2e, database, mysql, #extra_test_groups)]
#[test_log::test(sqlx::test(migrations = "../../../../../migrations/mysql"))]
async fn #test_function_name (mysql_pool: sqlx::MySqlPool) {
KamuCliApiServerHarness::mysql(&mysql_pool, #options )
Expand Down

0 comments on commit 3dc3df3

Please sign in to comment.