Fix race in Celery tests by pre-creating result tables (#8909)
Fix race in Celery tests by pre-creating result tables (#8909)

We noticed our Celery tests failing sometimes with

> (psycopg2.errors.UniqueViolation) duplicate key value violates unique
> constraint "pg_type_typname_nsp_index"
> DETAIL:  Key (typname, typnamespace)=(celery_tasksetmeta, 2200) already exists

It appears this is a race condition in SQLAlchemy's "create_all()"
function, where it first checks which tables exist, builds up a list of
`CREATE TABLE` statements, then issues them. Thus if two celery worker
processes start at the same time, they will find the the table doesn't
yet exist, and both try to create it.

This is _probably_ a bug in SQLA, but this should be an easy enough fix
here, to just ensure that the table exists before launching any Celery tasks.
cfei18/incubator-airflow,mistercrunch/airflow,nathanielvarona/airflow,Acehaidrey/incubator-airflow,lyft/incubator-airflow,bolkedebruin/airflow,nathanielvarona/airflow,wooga/airflow,apache/incubator-airflow,sekikn/incubator-airflow,cfei18/incubator-airflow,apache/airflow,Acehaidrey/incubator-airflow,DinoCow/airflow,nathanielvarona/airflow,mistercrunch/airflow,nathanielvarona/airflow,bolkedebruin/airflow,mrkm4ntr/incubator-airflow,danielvdende/incubator-airflow,cfei18/incubator-airflow,airbnb/airflow,wooga/airflow,Acehaidrey/incubator-airflow,dhuang/incubator-airflow,DinoCow/airflow,bolkedebruin/airflow,apache/airflow,sekikn/incubator-airflow,wooga/airflow,airbnb/airflow,DinoCow/airflow,mrkm4ntr/incubator-airflow,apache/incubator-airflow,dhuang/incubator-airflow,mrkm4ntr/incubator-airflow,danielvdende/incubator-airflow,lyft/incubator-airflow,mrkm4ntr/incubator-airflow,cfei18/incubator-airflow,nathanielvarona/airflow,sekikn/incubator-airflow,airbnb/airflow,wooga/airflow,cfei18/incubator-airflow,nathanielvarona/airflow,danielvdende/incubator-airflow,bolkedebruin/airflow,apache/airflow,apache/airflow,DinoCow/airflow,danielvdende/incubator-airflow,Acehaidrey/incubator-airflow,apache/airflow,sekikn/incubator-airflow,Acehaidrey/incubator-airflow,apache/airflow,danielvdende/incubator-airflow,bolkedebruin/airflow,Acehaidrey/incubator-airflow,dhuang/incubator-airflow,mistercrunch/airflow,lyft/incubator-airflow,apache/incubator-airflow,mistercrunch/airflow,dhuang/incubator-airflow,airbnb/airflow,apache/incubator-airflow,lyft/incubator-airflow,danielvdende/incubator-airflow,cfei18/incubator-airflow