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

Core tests fail when run separately #37466

Closed
2 tasks done
drajguru opened this issue Feb 15, 2024 · 3 comments
Closed
2 tasks done

Core tests fail when run separately #37466

drajguru opened this issue Feb 15, 2024 · 3 comments
Labels
area:core kind:bug This is a clearly a bug needs-triage label for new issues that we didn't triage yet pending-response

Comments

@drajguru
Copy link
Contributor

Apache Airflow version

main (development)

If "Other Airflow 2 version" selected, which one?

No response

What happened?

test_sqlite_relative_path() in test_settings.py seemingly puts the session into a state that prevents subsequent test modules from passing. I think during this test the session is re-initialized and this interferes other test modules due to it being a global object.

What you think should happen instead?

The test should mock out the session, engine... objects to avoid mutating the global state.

How to reproduce

breeze testing tests --test-type Core

! _pytest.outcomes.Exit: Unable clear test DB, got error sqlalchemy.exc.OperationalE
[SQL: DELETE FROM job]
(Background on this error at: https://sqlalche.me/e/14/e3q8) !
============ 193 passed, 4 skipped, 5 warnings in 65.27s (0:01:05) =============

Operating System

ubuntu 22.04

Versions of Apache Airflow Providers

No response

Deployment

Virtualenv installation

Deployment details

Using breeze

Anything else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@drajguru drajguru added area:core kind:bug This is a clearly a bug needs-triage label for new issues that we didn't triage yet labels Feb 15, 2024
@potiuk
Copy link
Member

potiuk commented Feb 16, 2024

Are you ABSOLUTELY sure you tested in on the latest main ?

Becauase I believe I fixed this very problem few days ago here: #37320 - where indeed original monkeypatching was not removed and all those things you are patching now were initialized as side effect.

But combining _AIRFLOW_SKIP_DB_TESTS and patching just Session and Engine which is a bit easier, does the trick in a much simpler way.

I just run breeze testing tests --test-type Core in main and it did not fail with the error you suggest, so likely you assessed it's wrong based on the version that was before.

Can you please re-verify if you still can reproduce the problem with latest main ? My feeling is that it is good now.

@potiuk
Copy link
Member

potiuk commented Feb 16, 2024

BTW. You Absolutely should not open issue for such things - just opening PR is more than enough, we hate beauraucracy (even the word is ugly) and in Airlfow, when you plan to open a PR, there is absolutely no need to open issue for it, it adds unnecessary overhead.

@drajguru
Copy link
Contributor Author

Oh I see... I just retested on the latest main and the issue is indeed now fixed.

@drajguru drajguru closed this as not planned Won't fix, can't repro, duplicate, stale Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:core kind:bug This is a clearly a bug needs-triage label for new issues that we didn't triage yet pending-response
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants