Skip to content

Fix github actions test failure#198

Merged
xzrderek merged 2 commits intomainfrom
cursor/fix-github-actions-test-failure-f724
Sep 20, 2025
Merged

Fix github actions test failure#198
xzrderek merged 2 commits intomainfrom
cursor/fix-github-actions-test-failure-f724

Conversation

@xzrderek
Copy link
Copy Markdown
Contributor


name: Pull Request
about: Propose changes to the codebase
title: "Fix: test_ensure_logging failure in CI due to disabled SQLite logger"
labels: ''
assignees: ''


Description

This PR fixes a flaky CI test, tests/pytest/test_pytest_ensure_logging.py::test_ensure_logging, which was failing because the SQLite logger was inadvertently disabled by the DISABLE_EP_SQLITE_LOG environment variable in the CI environment.

The test mocks SqliteEvaluationRowStore and asserts that its upsert_row method is called. However, when DISABLE_EP_SQLITE_LOG was set to "1" (as it was in CI), the NoOp logger was initialized instead of SqliteDatasetLoggerAdapter, preventing upsert_row from ever being called on the mock.

The fix involves explicitly setting DISABLE_EP_SQLITE_LOG="0" within the test using monkeypatch.setenv and resetting the lazy logger cache (default_logger._logger = None). This ensures the SqliteDatasetLoggerAdapter is correctly initialized and used during the test, allowing upsert_row to be called as expected. This change only affects the test environment and does not alter any production logic.

Fixes # (issue)
Implements # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Refactoring/Code cleanup
  • Build/CI/CD related changes
  • Other (please describe):

How Has This Been Tested?

The fix was verified by running the specific failing test locally after applying the changes.

  • pytest -q tests/pytest/test_pytest_ensure_logging.py::test_ensure_logging

Test Configuration:

  • Firmware version: N/A
  • Hardware: N/A
  • Toolchain: N/A
  • SDK: N/A

Checklist:

  • My code follows the style guidelines of this project (ran black ., isort ., flake8 .)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Screenshots (if applicable)

N/A

Additional context

This change is purely for test robustness in CI and does not impact the application's runtime behavior or logging configuration outside of this specific test.


Open in Cursor Open in Web

Co-authored-by: derek <derek@fireworks.ai>
@cursor
Copy link
Copy Markdown

cursor bot commented Sep 20, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@xzrderek xzrderek marked this pull request as ready for review September 20, 2025 00:09
@xzrderek xzrderek merged commit 1102b45 into main Sep 20, 2025
7 checks passed
@xzrderek xzrderek deleted the cursor/fix-github-actions-test-failure-f724 branch September 20, 2025 06:00
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