Repository navigation
Conversation
|
Thanks, this is a much more complete fix than #2383. I'd like to standardise on this approach and close #2383 in favour of this PR. There's one remaining source of flakiness that this PR doesn't cover yet:
Proposed fix (ported from #2383 to the code in this PR):
Nit: better failure output in
I've prepared both changes on this branch. |
| const DATASET_METADATA_DATASET = `df_integration_test_${DATASET_METADATA_SCHEMA_SUFFIX}`; | ||
| const DATASET_METADATA_ASSERTIONS_DATASET = `df_integration_test_assertions_${DATASET_METADATA_SCHEMA_SUFFIX}`; | ||
|
|
||
| const DATASETS = [ |
There was a problem hiding this comment.
DATASETS hard-codes which datasets bigquery_project creates. If the project ever writes to another dataset, that dataset is never dropped and the stale cleanup won't find it. Take the list from the compiled graph instead (the distinct target.schema of tables, assertions and operations). The same applies to evaluate.spec.ts and bigquery.spec.ts.
This fixes two classes of errors in integration tests:
tests/integration/jit.spec.tsrun in parallel and shared aTmpDirFixturecleaned up inafterEach, so the test that finished first deleted the other test's project directory. When that happened before the other test's JiT step, the JiT worker couldn't find@dataform/coreand the run failed withexpected 'FAILED' to deeply equal 'SUCCESSFUL'. BigQuery job history shows this in 16 of 388 CI runs over the last 90 days. Fix: each test owns its project directory and removes it infinally, so tests can't delete each other's files..