Skip to content

test: fix audit contract test isolation#452

Merged
ngjunsiang merged 1 commit intoweeklyfrom
testfix/audit-contract-test-isolation
Apr 10, 2026
Merged

test: fix audit contract test isolation#452
ngjunsiang merged 1 commit intoweeklyfrom
testfix/audit-contract-test-isolation

Conversation

@nycomp
Copy link
Copy Markdown
Contributor

@nycomp nycomp commented Apr 10, 2026

Summary

  • Fix test isolation for audit contract tests where data persisted between test classes
  • Use shared=False for fresh ServiceManager instances per test class
  • Move reset_test_data() from tearDown() to tearDownClass() to reset between classes rather than per-test
  • Fix trailing slash URLs to match route definitions (/traces/ not /traces)

Test Plan

Note: Contract tests (tests/contract/) are not covered by run_tests.py which only supports unit, integration, sanity, type, all categories.

Run contract tests directly:

poetry run python -m unittest discover tests/contract -v

Run all supported tests via test entrypoint:

poetry run python tests/run_tests.py all

Results

  • 27 contract tests run
  • "no such table: spans" errors eliminated
  • Remaining failures are route implementation issues (validation, limit param type), not test isolation

🤖 Generated with Claude Code

- Use shared=False for fresh ServiceManager instances per test class
- Move reset_test_data() from tearDown() to tearDownClass()
- Fix trailing slash URLs to match route definitions (/traces/ not /traces)
- Reset data after each test class instead of per-test to avoid
  reinitializing storage tables between every test

Fixes test isolation where data persisted between test classes,
causing "no such table: spans" errors after reset_test_data().

Related: Issue #427

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@ngjunsiang ngjunsiang merged commit fca259a into weekly Apr 10, 2026
4 checks passed
@nycomp nycomp deleted the testfix/audit-contract-test-isolation branch April 10, 2026 00: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.

2 participants