Skip to content

Conversation

@artem-vavilov
Copy link
Member

Issue

===========ERROR["test_find_channel_owner_returns_nil_for_channel_with_no_owner", "UserTest", 545.5476686069999]
 test_find_channel_owner_returns_nil_for_channel_with_no_owner#UserTest (545.55s)
Minitest::UnexpectedError:         Sequel::DatabaseError: Mysql2::Error::TimeoutError: Timeout waiting for a response from the last query. (waited 30 seconds)
            test/testing/projects_test_utils.rb:31:in `with_storage_id_for'

Links

@artem-vavilov artem-vavilov requested a review from a team January 8, 2026 19:02
@carl-codeorg carl-codeorg requested a review from Copilot January 8, 2026 19:08
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the with_channel_for test helper to use database transaction rollback instead of explicit cleanup, preventing test database timeout issues. The change wraps the channel creation in a transaction with rollback: :always, eliminating the need for manual deletion in an ensure block.

Key changes:

  • Replaced explicit cleanup (ensure block with deletion) with automatic transaction rollback
  • Added joinable: false transaction option to ensure proper isolation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@carl-codeorg carl-codeorg left a comment

Choose a reason for hiding this comment

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

I've run into issues with this helper before. Hope this fixes it!

@artem-vavilov artem-vavilov merged commit 666fe05 into staging Jan 8, 2026
6 checks passed
@artem-vavilov artem-vavilov deleted the project-test-utils-fix branch January 8, 2026 23:39
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