Module linera_views::test_utils

source ·
Expand description

Helper types for tests.

Modules§

Functions§

  • Adds a prefix to a list of key-values
  • Reading many keys at a time could trigger an error. This needs to be tested.
  • Takes a random number generator, a key_prefix and extends it by n random bytes.
  • Returns a random key prefix used for tests
  • A bunch of puts and some deletes.
  • Takes a random number generator rng, a number n and returns n random (key, value) which are all distinct with key and value being of length 8.
  • Generates a list of random key-values with no duplicates
  • Takes a random number generator, a key_prefix and generates pairs (key, value) with key obtained by appending 8 bytes at random to key_prefix and value obtained by appending 8 bytes to the trivial vector. We return n such (key, value) pairs which are all distinct
  • Builds a random k element subset of n
  • We build a number of scenarios for testing the reads.
  • Appends a small value to a key making collisions likely.
  • Exercises the namespace functionalities of the AdminKeyValueStore. This tests everything except the delete_all which would interact with other namespaces.
  • Tests listing the root keys.
  • DynamoDB has limits at 1 MB (for pagination), 4 MB (for write) Let us go right past them at 20 MB of data with writing and then reading it. And 20 MB is not huge by any mean. All KeyValueStore must handle that.
  • This test starts with a collection of key/values being inserted into the code which is then followed by a number of reading tests. The functionalities being tested are all the reading functionalities:
  • Writes and then reads data under a prefix, and verifies the result.
  • Run many operations on batches always starting from a blank state.
  • Run some deterministic and random batches operation and check their correctness
  • A random reordering of the puts and deletes. For something like MapView it should get us the same result whatever way we are calling.
  • That test is especially challenging for ScyllaDB. In its default settings, Scylla has a limitation to 10000 tombstones. A tombstone is an indication that the data has been deleted. That is thus a trie data structure for checking whether a requested key is deleted or not.