Bug description
set tagging system feature flag to true and start unit tests update_tests.py will fail due to enabling tagging event_listeners
Screenshots/recordings
No response
Superset version
master / latest-dev
Python version
3.9
Node version
16
Browser
Chrome
Additional context
No response
Checklist
- [ ] I have searched Superset docs and Slack and didn't find a solution to my problem.
- [ ] I have searched the GitHub issue tracker and didn't find a similar bug report.
- [ ] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
Comment From: dosubot[bot]
The test failures happen because enabling the tagging system feature flag globally causes SQLAlchemy event listeners to be registered for the entire test run. These listeners introduce side effects that break tests not designed to handle them, like update_tests.py
source.
Integration tests use a fixture (with_tagging_system_feature
) to enable the feature flag and register/clear event listeners for each test, ensuring isolation source. Unit tests like update_tests.py
do not use this fixture, so listeners leak across test boundaries and cause unpredictable errors.
To avoid failures, do not enable the tagging system feature flag globally for all tests. Instead, use a setup/teardown fixture to register and clear event listeners only for tests that need tagging. This pattern is already used in integration tests and can be adapted for unit tests. There is no built-in mechanism to automatically clean up listeners when the global flag changes, so explicit isolation is necessary.
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other