You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/03/14 11:55:15 UTC

[GitHub] [airflow] potiuk opened a new issue #14773: [QUARANTINE] The test_verify_integrity_if_dag_changed occasionally fails

potiuk opened a new issue #14773:
URL: https://github.com/apache/airflow/issues/14773


   https://github.com/apache/airflow/pull/14531/checks?check_run_id=2106170690#step:6:10298
   
   Looks like it is connected with #14772 
   
   ```
   ____________ TestSchedulerJob.test_verify_integrity_if_dag_changed _____________
     
     self = <tests.jobs.test_scheduler_job.TestSchedulerJob testMethod=test_verify_integrity_if_dag_changed>
     
         def test_verify_integrity_if_dag_changed(self):
             # CleanUp
             with create_session() as session:
                 session.query(SerializedDagModel).filter(
                     SerializedDagModel.dag_id == 'test_verify_integrity_if_dag_changed'
                 ).delete(synchronize_session=False)
         
             dag = DAG(dag_id='test_verify_integrity_if_dag_changed', start_date=DEFAULT_DATE)
             BashOperator(task_id='dummy', dag=dag, owner='airflow', bash_command='echo hi')
         
             scheduler = SchedulerJob(subdir=os.devnull)
             scheduler.dagbag.bag_dag(dag, root_dag=dag)
             scheduler.dagbag.sync_to_db()
         
             session = settings.Session()
             orm_dag = session.query(DagModel).get(dag.dag_id)
             assert orm_dag is not None
         
             scheduler = SchedulerJob(subdir=os.devnull)
             scheduler.processor_agent = mock.MagicMock()
             dag = scheduler.dagbag.get_dag('test_verify_integrity_if_dag_changed', session=session)
             scheduler._create_dag_runs([orm_dag], session)
         
             drs = DagRun.find(dag_id=dag.dag_id, session=session)
             assert len(drs) == 1
             dr = drs[0]
         
             dag_version_1 = SerializedDagModel.get_latest_version_hash(dr.dag_id, session=session)
             assert dr.dag_hash == dag_version_1
             assert scheduler.dagbag.dags == {'test_verify_integrity_if_dag_changed': dag}
             assert len(scheduler.dagbag.dags.get("test_verify_integrity_if_dag_changed").tasks) == 1
         
             # Now let's say the DAG got updated (new task got added)
             BashOperator(task_id='bash_task_1', dag=dag, bash_command='echo hi')
     >       SerializedDagModel.write_dag(dag=dag)
     
     tests/jobs/test_scheduler_job.py:2827: 
     _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
     airflow/utils/session.py:65: in wrapper
         return func(*args, session=session, **kwargs)
     /usr/local/lib/python3.6/contextlib.py:88: in __exit__
         next(self.gen)
     airflow/utils/session.py:32: in create_session
         session.commit()
     /usr/local/lib/python3.6/site-packages/sqlalchemy/orm/session.py:1046: in commit
         self.transaction.commit()
     /usr/local/lib/python3.6/site-packages/sqlalchemy/orm/session.py:504: in commit
         self._prepare_impl()
     /usr/local/lib/python3.6/site-packages/sqlalchemy/orm/session.py:483: in _prepare_impl
                                     value_params,
                                     True,
                                 )
         
                 if check_rowcount:
                     if rows != len(records):
                         raise orm_exc.StaleDataError(
                             "UPDATE statement on table '%s' expected to "
                             "update %d row(s); %d were matched."
     >                       % (table.description, len(records), rows)
                         )
     E                   sqlalchemy.orm.exc.StaleDataError: UPDATE statement on table 'serialized_dag' expected to update 1 row(s); 0 were matched.
     
     /usr/local/lib/python3.6/site-packages/sqlalchemy/orm/persistence.py:1028: StaleDataError
   ```
   
   
   <!--
   
   Welcome to Apache Airflow!  For a smooth issue process, try to answer the following questions.
   Don't worry if they're not all applicable; just try to include what you can :-)
   
   If you need to include code snippets or logs, please put them in fenced code
   blocks.  If they're super-long, please use the details tag like
   <details><summary>super-long log</summary> lots of stuff </details>
   
   Please delete these comment blocks before submitting the issue.
   
   -->
   
   <!--
   
   IMPORTANT!!!
   
   PLEASE CHECK "SIMILAR TO X EXISTING ISSUES" OPTION IF VISIBLE
   NEXT TO "SUBMIT NEW ISSUE" BUTTON!!!
   
   PLEASE CHECK IF THIS ISSUE HAS BEEN REPORTED PREVIOUSLY USING SEARCH!!!
   
   Please complete the next sections or the issue will be closed.
   These questions are the first thing we need to know to understand the context.
   
   -->
   
   **Apache Airflow version**:
   
   
   **Kubernetes version (if you are using kubernetes)** (use `kubectl version`):
   
   **Environment**:
   
   - **Cloud provider or hardware configuration**:
   - **OS** (e.g. from /etc/os-release):
   - **Kernel** (e.g. `uname -a`):
   - **Install tools**:
   - **Others**:
   
   **What happened**:
   
   <!-- (please include exact error messages if you can) -->
   
   **What you expected to happen**:
   
   <!-- What do you think went wrong? -->
   
   **How to reproduce it**:
   <!---
   
   As minimally and precisely as possible. Keep in mind we do not have access to your cluster or dags.
   
   If you are using kubernetes, please attempt to recreate the issue using minikube or kind.
   
   ## Install minikube/kind
   
   - Minikube https://minikube.sigs.k8s.io/docs/start/
   - Kind https://kind.sigs.k8s.io/docs/user/quick-start/
   
   If this is a UI bug, please provide a screenshot of the bug or a link to a youtube video of the bug in action
   
   You can include images using the .md style of
   ![alt text](http://url/to/img.png)
   
   To record a screencast, mac users can use QuickTime and then create an unlisted youtube video with the resulting .mov file.
   
   --->
   
   
   **Anything else we need to know**:
   
   <!--
   
   How often does this problem occur? Once? Every time etc?
   
   Any relevant logs to include? Put them here in side a detail tag:
   <details><summary>x.log</summary> lots of stuff </details>
   
   -->
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk closed issue #14773: [QUARANTINE] The test_verify_integrity_if_dag_changed occasionally fails

Posted by GitBox <gi...@apache.org>.
potiuk closed issue #14773:
URL: https://github.com/apache/airflow/issues/14773


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org