Skip to content

Conversation

@ptiurin
Copy link
Contributor

@ptiurin ptiurin commented Nov 24, 2025

This pull request addresses a bug in the Firebolt engine caching logic that previously caused incorrect database context to be used when switching databases with the same engine. The main fix ensures that the database parameter is not cached with engine information, preventing database context from being overwritten when reusing engine cache entries. The changes also add comprehensive integration and unit tests to verify correct behavior for both async and sync connections, and update test factories for better flexibility.

Bug Fixes and Engine Caching Improvements:

  • Updated use_engine and use_engine_async methods to exclude the database parameter from engine cache entries, ensuring that switching databases with the same engine does not overwrite the database context. [1] [2]

Testing Enhancements:

  • Added new integration and unit tests (both async and sync) to verify that switching databases with the same engine preserves the correct database context and that the engine cache does not contain the database parameter. [1] [2] [3]
  • Updated connection factory fixtures in both async and sync test suites to allow dynamic selection of the database parameter, improving test flexibility and coverage. [1] [2]

@ptiurin ptiurin marked this pull request as ready for review November 24, 2025 19:46
@ptiurin ptiurin requested a review from a team as a code owner November 24, 2025 19:46
@sonarqubecloud
Copy link

@ptiurin ptiurin merged commit 772af1e into main Nov 25, 2025
20 of 21 checks passed
@ptiurin ptiurin deleted the fix-database-cache-logic branch November 25, 2025 13:20
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.

3 participants