Skip to content

[BUG] dbt-deps tests are flaky when running multi-threaded #353

@fornwall

Description

@fornwall

Describe the bug
When running cargo test -p dbt-deps the tests in private_package::tests are flaky and sometimes fails due to concurrency issues, with multiple tests interfering with each other due to them manipulating the DBT_ENV_PRIVATE_GIT_PROVIDER_INFO environment variable:

thread 'private_package::tests::test_private_packages' panicked at crates/dbt-deps/src/private_package.rs:148:63:
called Result::unwrap() on an Err value: FsError { code: InvalidConfig, location: None, context: "Invalid private package configuration: 'dbt-labs/dbt-integration-project' provider: ''", cause: None }

The failure is flaky - use e.g. while cargo test -p dbt-deps ; do; done to run the tests in a loop until there is a failure.

A workaround that makes the tests pass consistently is to limit concurrency: cargo test -p dbt-deps -- --test-threads=1

What version of dbt Fusion is this bug in? (find out by running dbt --version)
2.0.0-beta.34

Is this a discrepancy between the dbt Fusion Engine and dbt Core? Check one.

  • YES
  • NO

To Reproduce
Run while cargo test -p dbt-deps ; do; done on a computer with enough cores.

Expected behavior
The tests should pass consistently.

Operating System and CPU Type (please complete the following information):

  • Linux and Mac
  • ARM and X86

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions