Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
73416: spanconfig/{sqltranslator,testcluster}: support multi-tenant tests r=irfansharif a=irfansharif **spanconfig/{sqltranslator,testcluster}: support multi-tenant tests** We introduce a nimble testing framework for multi-tenant span config tests, and use it to power tests for spanconfig.SQLTranslator when run on behalf of secondary tenants. This framework will see further addition when testing spanconfig.Reconciler -- we'll maintain a handle on each tenant's reconciler, kvaccessor, and use both to determine what span config mutations are made after SQL changes. This commit also leverages the ExcludeDroppedDescriptorsFromLookup testing knob we introduced in an earlier commit -- it obviates the need for arbitrary sleeps (which are both fragile and slow). It also packages a PrintSpanConfigDiffedAgainstDefaults helper that we'll use in a future PR (#71994). **sqltranslatorccl: carve standalone package for tests** Rename-only commit. We'll use subpackages within ccl/spanconfigccl when testing other components (spanconfig.Reconciler; [#71994](#71994)). **spanconfig/{watcher,translator}: add testing knobs** We introduce two testing knobs that we'll use in future commits: - SQLWatcherCheckpointNoopsEveryDurationOverride, if set, will override how often the SQLWatcher checkpoints no-ops (follow up to [#73171](#73171)) - ExcludeDroppedDescriptorsFromLookup will control whether the SQLTranslator ignores dropped descriptors. We'll also use this knob for the Reconciler ([#71994](#71994)), for the same purpose. Ignoring dropped descriptors in tests is a convenient (and faster!) alternative to waiting for the descriptor to actually get GC-ed by the GC job. It also makes it easier to order events transactionally -- it's sufficient for a checkpoint to cross the timestamp when the table is dropped, instead of waiting for the GC job to pick it up post TTL. This latter form is used in our current sqltranslator tests where we sleep arbitrarily: # Sleep for 5 seconds, which is more than the TTL on db.t1, so that # the gc job can delete the descriptor. sleep duration=5 This is unfortunate and makes for slower tests than necessary. We can get rid of it in a subsequent commit. Release note: None Co-authored-by: irfan sharif <irfanmahmoudsharif@gmail.com>
- Loading branch information