Repository navigation
Test Failures in the pipeline #642
Description
Activity
Hi Saurabh Singh (@saurabh500), thank you for opening this issue!
Our team will review it shortly. We aim to triage all new issues within 24-48 hours and get back to you.
If you have additional information to share, please feel free to update the issue.
Thank you for your patience!
- addedtriage neededFor new issues, not triaged yet.For new issues, not triaged yet.
on Jun 23, 2026 - addedbugSomething isn't workingSomething isn't workingtriage doneIssues that are triaged by dev team and are in investigation.Issues that are triaged by dev team and are in investigation.and removedtriage neededFor new issues, not triaged yet.For new issues, not triaged yet.
on Jun 25, 2026 Hi Saurabh Singh (@saurabh500) , Thanks for raising the bug. I have addressed the issue under attached PR. Below is the fix summary -
Summary:
This pull request improves the robustness of the Cursor class initialization and cleanup logic, ensuring that partially-initialized or half-constructed cursor objects are handled safely and do not cause unraisable exceptions during garbage collection. It also adds regression tests to prevent recurrence of related bugs.Initialization and cleanup robustness:
The init method in cursor.py now sets self.closed = False and self.hstmt = None as the very first statements, before any code that might raise an exception, ensuring that even partially-initialized Cursor instances have a consistent state for cleanup. [1] [2]
The close() method now safely checks for the existence of the closed attribute using getattr(self, "closed", True), preventing AttributeError if the attribute is missing (e.g., in half-initialized objects).
The del method now uses the correct sys.is_finalizing() function (instead of the incorrect sys._is_finalizing()) and guards logging calls to prevent unraisable exceptions during interpreter shutdown.Testing and regression prevention:
Adds test_cursor_del_half_initialized_cursor_no_errors and test_cursor_init_failure_leaves_consistent_state to ensure that half-initialized cursors do not raise unraisable exceptions during garbage collection and that failed initialization leaves the cursor and connection in a consistent, recoverable state.saurabh500 commented
on Jun 27, 2026 ContributorAuthorMore actionsSubrata (@subrata-ms) I think the more important questions is "Why did the pipeline not fail? "
This is a problem that should be solved, to prevent any changes going in, despite failed tests.- added a commit that references this issue
on Jul 29, 2026 Hi Saurabh Singh (@saurabh500) , the pipeline didn't catch this error because the error is a warning, not a test failure — and nothing in this repo's pytest config promotes warnings to errors.
Reacted by Saurabh Singh- added a commit that references this issue
on Aug 7, 2026
Found this failure while looking into the pipelines.
https://sqlclientdrivers.visualstudio.com/public/_build/results?buildId=157865&view=logs&j=15f12f6b-5115-5c90-8b46-492e8e236788&t=c7b07bc8-4166-5494-ac4e-f321834baa1c&s=d654deb9-056d-50a2-1717-90c08683d50a
https://sqlclientdrivers.visualstudio.com/public/_build/results?buildId=157685&view=logs&j=15f12f6b-5115-5c90-8b46-492e8e236788&t=c7b07bc8-4166-5494-ac4e-f321834baa1c
Example job
Run pytest with coverage in Ubuntu ARM64 containerThe failures are silently ignored.