The test helpers isolate by test run, not by test. scoped_database_helper takes its tenant from the environment, so every test in one run shares that tenant, and a test binary run by hand with the .env tenant shares it across runs too. This is by design (the helper says no truncation is needed), but nothing says that a test must therefore use keys of its own. Two marketdata tests broke other suites intermittently by writing to a surface another suite reads, and a two-party import test failed on its first import because an earlier test had left the same surface in the shared tenant. Write the convention down in the helpers and in the testing guide: one currency pair or curve id per test, and fresh ids for anything a test writes. Consider a helper that makes a tenant of its own for tests that need one.
Table of Contents
This page is a capture in the inbox bucket of the product backlog — a pre-sprint idea, not yet pulled into a sprint as a story.
1. What
Say in the testing guide that the test helpers isolate by test run and not by test. Every test in one run shares one tenant, so a test must use keys of its own, such as a currency pair or a curve id no other test uses.
2. Why
The helper needs no truncation, so a surface or a series that one test writes is still there for the next test. Two marketdata tests broke other suites intermittently because of it: a lister test that added axes to a pair another test read, and a derived point test that shared a pair. Each now has a pair of its own, and eight clean runs followed. Nothing in the guide tells the next author to do the same.
3. References
projects/ores.marketdata/core/tests/service_series_identity_lister_tests.cppprojects/ores.marketdata/core/tests/service_manual_point_service_tests.cpp, which picks unused pairs for the same reason
4. See also
- The testing guide, as the place to document the convention.