Skip to main content

Tests: internal/migrate

internal/migrate · 64 tests

Each test is named for the property it holds, and runs against a real deployment: there is no mock of the database and no arm that skips when it is absent. The sentence is the test's name read back; the name is what go test -run takes.

access_test.go

anchoridentity_test.go

chunkidentity_test.go

connectionbound_test.go

  • A pool the server cannot satisfy is refused at startup with both numbersTestAPoolTheServerCannotSatisfyIsRefusedAtStartupWithBothNumbers. ── #197 ────────────────────────────────────────────────────────────────────────────────────── The failure this holds against was measured, not imagined: twenty-eight workers and an API against max_connections=80 lost ten of 1,397 documents and logged 357 worker drain failures in thirty minutes, every one of them the server refusing a session.
  • An oversubscribed server reports no headroom rather than a negative oneTestAnOversubscribedServerReportsNoHeadroomRatherThanANegativeOne. A budget that has been oversubscribed by other processes reports no headroom rather than a negative one: below zero would read as a different kind of fault than full.

ingestion_test.go

instance_test.go

integrity_test.go

migrate_test.go

namespacelock_test.go

  • Starters provisioning one namespace together all succeedTestStartersProvisioningOneNamespaceTogetherAllSucceed. Starters that provision one fresh namespace together all succeed, and each migration is recorded once: the lock makes them take turns rather than fail on what another just created.
  • A migration waits for the namespace lockTestAMigrationWaitsForTheNamespaceLock. A migration waits while another session holds the namespace's lock, and proceeds when it is released: the lock is the one Apply takes, not a lock that merely exists.

ontology_test.go

  • A relation outside the vocabulary cannot be storedTestARelationOutsideTheVocabularyCannotBeStored. ── #5's claim: the vocabulary is closed, and closed by the database ─────────────────────────── The refusal is asserted through a direct INSERT rather than through the write path, because the point is that NO path can store an unknown relation — including one written by hand during an incident, which is exactly when a convention enforced in application code is bypassed.
  • Retiring a predicate in use is refusedTestRetiringAPredicateInUseIsRefused. A predicate cannot be retired while facts still use it.
  • Every semantic type has a predicate in itTestEverySemanticTypeHasAPredicateInIt. The declared semantic types and the seeded rows cannot drift apart.
  • The vocabulary stays within its declared boundsTestTheVocabularyStaysWithinItsDeclaredBounds. The size of the vocabulary is itself the decision.
  • The unresolvable terms are a closed set in the schemaTestTheUnresolvableTermsAreAClosedSetInTheSchema. The set is in the database, for the reason the predicate vocabulary is: a closed set belongs where it is enforced, not where it is remembered.
  • Every unresolvable term is stored normalisedTestEveryUnresolvableTermIsStoredNormalised. Every term is stored in the form the resolver would compare against.

planes_test.go

privileges_test.go

provision_test.go

runtimeconnection_test.go

  • A runtime connection carries keepalives and a client checkTestARuntimeConnectionCarriesKeepalivesAndAClientCheck. A runtime connection reaches the server with keepalives that end a vanished client's session, and its locks, in about a minute, and with a check that cancels a query whose client has gone .

speaker_test.go