Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E2E: modify a workaround for MySQL tests #767

Merged
merged 4 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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::)"
zaychenko-sergei marked this conversation as resolved.
Show resolved Hide resolved
test-group = "mysql"
retries = { count = 3, backoff = "exponential", delay = "3s" }

[[profile.default.overrides]]
filter = "test(::setup::)"
test-group = "setup"
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased
### Changed
- Upgraded to `datafusion v41` (#713)
### Fixed
- E2E: added additional force off colors to exclude sometimes occurring ANSI color sequences
- E2E: modify a workaround for MySQL tests

## [0.194.1] - 2024-08-14
### Fixed
Expand Down
1 change: 1 addition & 0 deletions src/app/cli/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,7 @@ fn configure_logging(
.with_span_events(FmtSpan::NEW | FmtSpan::CLOSE)
.with_writer(std::io::stderr)
.pretty()
.with_ansi(!no_color_output)
.init();

return Guards::default();
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
2 changes: 1 addition & 1 deletion src/utils/kamu-cli-puppet/src/kamu_cli_puppet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ impl KamuCliPuppet {
{
let mut command = assert_cmd::Command::cargo_bin("kamu-cli").unwrap();

command.env("RUST_LOG", "trace");
command.env("RUST_LOG", "info,sqlx=debug");

command.arg("-v");
command.arg("--no-color");
Expand Down
Loading