CHORE: Create devcontainer for repo #147
+363
−0
Merged
Azure Pipelines / MSSQL-Python-PR-Validation
succeeded
Feb 4, 2026 in 16m 52s
Build #pr-validation-pipeline had test failures
Details
- Failed: 1 (0.00%)
- Passed: 24,843 (97.13%)
- Other: 734 (2.87%)
- Total: 25,578
- 5458 of 7121 lines covered (76.65%)
Annotations
Check failure on line 1 in test_no_segfault_on_gc
azure-pipelines / MSSQL-Python-PR-Validation
test_no_segfault_on_gc
AssertionError: Expected no segfault, but got:
assert -11 == 0
+ where -11 = CompletedProcess(args=['/opt/venv/bin/python', '-c', '\nfrom mssql_python import connect\nconn = connect("Server=172.17.0.4;Database=TestDB;Uid=SA;Pwd=Azure@123!;TrustServerCertificate=yes")\ncursors = [conn.cursor() for _ in range(5)]\nfor cur in cursors:\n cur.execute("SELECT 1")\n cur.fetchall()\ndel conn\nimport gc; gc.collect()\ndel cursors\ngc.collect()\n '], returncode=-11, stdout='', stderr='').returncode
Raw output
conn_str = 'Server=172.17.0.4;Database=TestDB;Uid=SA;Pwd=Azure@123!;TrustServerCertificate=yes'
def test_no_segfault_on_gc(conn_str):
"""Test that no segmentation fault occurs during garbage collection"""
# Properly escape the connection string for embedding in code
escaped_conn_str = conn_str.replace("\\", "\\\\").replace('"', '\\"')
code = f"""
from mssql_python import connect
conn = connect("{escaped_conn_str}")
cursors = [conn.cursor() for _ in range(5)]
for cur in cursors:
cur.execute("SELECT 1")
cur.fetchall()
del conn
import gc; gc.collect()
del cursors
gc.collect()
"""
# Run the code in a subprocess to avoid segfaults in the main process
# This is a workaround to test for segfaults in Python, as they can crash the interpreter
# and pytest does not handle segfaults gracefully.
# Note: This is a simplified example; in practice, you might want to use a more robust method
# to handle subprocesses and capture their output/errors.
result = subprocess.run([sys.executable, "-c", code], capture_output=True, text=True)
> assert result.returncode == 0, f"Expected no segfault, but got: {result.stderr}"
E AssertionError: Expected no segfault, but got:
E assert -11 == 0
E + where -11 = CompletedProcess(args=['/opt/venv/bin/python', '-c', '\nfrom mssql_python import connect\nconn = connect("Server=172.17.0.4;Database=TestDB;Uid=SA;Pwd=Azure@123!;TrustServerCertificate=yes")\ncursors = [conn.cursor() for _ in range(5)]\nfor cur in cursors:\n cur.execute("SELECT 1")\n cur.fetchall()\ndel conn\nimport gc; gc.collect()\ndel cursors\ngc.collect()\n '], returncode=-11, stdout='', stderr='').returncode
tests/test_005_connection_cursor_lifecycle.py:105: AssertionError
Loading