Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix side effects in DBT Cloud tests #39511

Merged
merged 1 commit into from
May 9, 2024

Conversation

Taragolis
Copy link
Contributor

Fixup flakey test tests/providers/dbt/cloud/operators/test_dbt.py::TestDbtCloudRunJobOperator::test_execute_wait_for_termination which depends on a system time. As a bonus test run time is reduced

            else:
                # When the job run status is not in a terminal status or "Success", the operator will
                # continue to call ``get_job_run()`` until a ``timeout`` number of seconds has passed
                # (3 seconds for this test).  Therefore, there should be 4 calls of this function: one
                # initially and 3 for each check done at a 1 second interval.
>               assert mock_get_job_run.call_count == 4
E               AssertionError: assert 3 == 4
E                +  where 3 = <MagicMock name='get_job_run' id='140043051658976'>.call_count

tests/providers/dbt/cloud/operators/test_dbt.py:264: AssertionError

In addition changed current directory in tests where we provide relative paths, otherwise this is a matter of time when we accidentally merge in main branch files test-generated


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@Taragolis Taragolis added the changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) label May 9, 2024
@potiuk
Copy link
Member

potiuk commented May 9, 2024

NICE!

Copy link
Contributor

@josh-fell josh-fell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

@josh-fell josh-fell merged commit f973502 into apache:main May 9, 2024
39 checks passed
RodrigoGanancia pushed a commit to RodrigoGanancia/airflow that referenced this pull request May 10, 2024
pateash pushed a commit to pateash/airflow that referenced this pull request May 13, 2024
romsharon98 pushed a commit to romsharon98/airflow that referenced this pull request Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:providers changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) provider:dbt-cloud
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants