lanterndata/lantern

Create a general shared variable to communicate DB internal state to SQL for tests

Ngalstyan4 opened this issue · 0 comments

We want to make sure our regression tests cover different scenarios in which a feature can be used.
These different scenarios do not always have SQL-visible output. For these cases we currently rely on adding elog(DEBUG5,..) statements and make sure those elogs are only enabled for the test under question.

See PRs #78 and #103 For more details on how this kind of testing works. In #78, for example, with this kinds of elogs we make sure that for different values of init_k usearch_search is triggered expected number of times.

This has downsides

  • elogs have performance impact even if their output is not logged anywhere.
  • Postgres itself prints logs at the enabled level which at various points result in sporadic, unrelated, benign regressions

It would be better to add a special variable on an internal schema `(e.g. _lanterndb_internal.state_for_tests) that can be used to comminicate data to our regression tests. In tests where we want to enable this kind of communication we would set the variable and print it from the regression test