Skip to content

Chore: Address more integration test flakiness#5258

Merged
erindru merged 3 commits intomainfrom
erin/test-flakiness
Aug 29, 2025
Merged

Chore: Address more integration test flakiness#5258
erindru merged 3 commits intomainfrom
erin/test-flakiness

Conversation

@erindru
Copy link
Collaborator

@erindru erindru commented Aug 28, 2025

This addresses:

  • An oversight in tearing down the database for Redshift that caused this failure
  • The failures caused by teardown failed on attempt N! Exiting immediately! when there is a StashKey error

I had a handler for capturing the StashKey errors and it worked - if pytest-retry wasnt in the mix. So it was working for style_and_cicd_tests but not the engine adapter integration tests.

pytest-retry registers its own handler, which runs before ours and bombs out before we even have a chance to handle the error.

So this PR adjusts the hook call order at runtime to call ours first before the one from pytest-retry

# because unregister() apparently doesnt unregister plugins cleanly in such a way they can be re-registered
#
# so what we end up doing below is a small monkey-patch to adjust the call order of the hooks
pm = config.pluginmanager
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I tried quite a few things, including trying to register tests as a pytest plugin in pyproject.toml (which has its own set of problems) before arriving at this implementation as the least horrendous option

Comment on lines +313 to +316
#filters:
# branches:
# only:
# - main
Copy link
Collaborator

Choose a reason for hiding this comment

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

Reminder to revert this

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

thanks :)

This reverts commit f455332.
@erindru erindru enabled auto-merge (squash) August 28, 2025 23:50
@erindru erindru merged commit ecdbbde into main Aug 29, 2025
36 checks passed
@erindru erindru deleted the erin/test-flakiness branch August 29, 2025 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants