dbt-labs / dbt-adapter-tests

a pytest plugin for dbt adapter test suites
19 stars 11 forks source link

introspecting hangup during `dbt run` sequence steps #24

Open dataders opened 3 years ago

dataders commented 3 years ago

problem

our adapter runs perfectly for jaffle_shop and another user have been able to been using the adapter successfully for an internal data engineering project.

however, we're woefully stuck trying to diagnose why certain dbt-adapter-tests squences are hanging -- specifically at the following places of the tests we've tried to run so far (all variations of dbt run)

details

here's a gist of some of the failure outputs when we run pytest test/integration/shinynewdb.dbtspec -xs --ff

Basically you can see that the first two steps, seed and testing that the seed length is correct. We're also getting helpful logs streamed w/ the addition of pytests -s flag.

The challenge is that upon arrival at step 3, we can no longer introspect. So we need help either getting more info, or, best-case scenario. solving the problem outright!

tried so far

Things we've tried so far to get more information:

using pytest's -s flag

still no output, just Executing step 3/15

peppering{{ log() }} statements everywhere

I added log statements throughout shinynewdb's custom materializations for table and view. basically trying to understand at what point dbt run might be getting stuck... but nothing shows up in the pytest console output?

db's query_history and running_queries tables

looking at the shinynewdb's query_history and running_queries tables show that:

questions

atten

cc: @jtcohen6 image

dataders commented 3 years ago

as an update, @drewbanin helpfully shared that adding something like below to the beginning of run_test() in the spec_file.py (around line 749) will at least print out the temporary location of dbt.log which can be used to see logged statements.

print(f'temp log file: {tmpdir}/project/logs/dbt.log')

as a result, we were able to notice an error a relation results test failing with:

there's still something weird going on where after the dbt run step there's a huge hangtime. I guess we'll investigate further at a later time. here's the most recent dbt.log where it hangs up, though sometimes it finishes without issue...