dbt-labs / dbt-labs/dbt-adapters

[Bug] Same temp table is used for different unit tests

Open
#222 7 comments 1 reaction 0 assignees View on GitHub
feature:unit-tests Stale type:bug
Dominant language
Python
Stars
233
Forks
362
Avg merge
3d 22h
Merged PRs (30d)
9

Description

### Is this a new bug in dbt-bigquery?

- [X] I believe this is a new bug in dbt-bigquery
- [X] I have searched the existing issues, and I could not find an existing issue for this bug

### Current Behavior

When some unit tests in different models have the same name (like `test_compute_one_line`), some tests can fail depending on racing conditions (threads > 1).
The temp table name is `__dbt_tmp`, so 1 test can override the content of another one.

### Expected Behavior

Unit tests should run in parallel, without impacting other one, regardless their naming.
ATM I'm forced to run my tests with `--threads 1` to prevent the issue

### Steps To Reproduce

1. Create 2 models
2. Create a unit test within each model, both with the same name
3. Run the test with `--threads` > 1

### Relevant log output

_No response_

### Environment

```markdown
- OS: OS X 14.4.1
- Python: 3.11
- dbt-core: 1.8.0
- dbt-bigquery: 1.8.1
```

### Additional Context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.