Documentation
¶
Overview ¶
Package obsdbtest is the shared conformance table for obsdb.DB backends — the executable form of S3.5's promises, the storetest pattern. Every backend runs it (sqlite here, clickhouse in its own module); Run takes a factory so each subtest gets a fresh database.
Index ¶
- func CheckTurnFactFilters(t *testing.T, db obsdb.DB)
- func CommandsPruneRace(t *testing.T, db obsdb.DB, between func(fn func(rule string)) (remove func()))
- func CommandsRestart(t *testing.T, open func(t *testing.T) (first obsdb.DB, reopen func() obsdb.DB))
- func Run(t *testing.T, open func(t *testing.T) obsdb.DB)
- func SummarizerSpanIsNotRunFact(t *testing.T, db obsdb.DB)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckTurnFactFilters ¶ added in v0.18.0
CheckTurnFactFilters pins the SQL against Go over whatever db holds (U16-fix; every conformance fixture runs it, TestContract every contract fixture): each listed session's turn facts as the list's SQL counts them equal obsdb.SessionTurnFacts over the session's runs in Go (Session's), and SessionQuery's Awaiting and Failed filters keep exactly the sessions whose Go facts say Pending > 0 and FailedTurns > 0, and its Status filter those whose newest outcome is the word. Every read sees one view of the session's turns — the same retention cut (ClickHouse's weft_runs TTL) on each: the list's Turns is the Session's, its len(Runs) and Runs{SessionID}'s Total, so a read that kept a turn another cut is caught.
func CommandsPruneRace ¶ added in v0.15.0
func CommandsPruneRace(t *testing.T, db obsdb.DB, between func(fn func(rule string)) (remove func()))
CommandsPruneRace holds obsdb.CommandStore.PruneCommands to its race rule: a Put that lands after a prune rule chose its rows and before it deleted them survives the prune with its own values. between arranges for fn to run inside PruneCommands at that point, once per rule — named "age", "keep", "routes", "runtimes" (fn ignores any other name) — and returns what removes the arrangement. A backend whose prune holds its writes off for the whole of each rule has no such point: its between calls fn for each of the four names before returning, and the Puts then precede the prune, which must keep them too. It skips when the backend is not a CommandStore.
func CommandsRestart ¶ added in v0.15.0
func CommandsRestart(t *testing.T, open func(t *testing.T) (first obsdb.DB, reopen func() obsdb.DB))
CommandsRestart is the restart property the runtime server builds on (plan I3): what one Studio process wrote through obsdb.CommandStore, a second one opened on the same storage after the first closed reads back — commands with their accepted and heartbeat times, routes, breakpoints, runtimes. open returns the first handle and a func that opens a second on the same storage; the case closes the first before calling it. It skips when the backend is not a CommandStore.
func Run ¶
Run executes the conformance table against a backend. open returns a fresh DB for each subtest; the table never shares state between them.
func SummarizerSpanIsNotRunFact ¶ added in v0.18.0
SummarizerSpanIsNotRunFact is the SummarizerSpanIsNotRunFact case of Run on one database db, empty of the case's sessions: a backend's upgrade test runs it on a database built at an older schema and opened by this binary (ClickHouse's 0027 restating 0024's view).
Types ¶
This section is empty.