MCPcopy Create free account
hub / github.com/PostHog/duckgres / TestOrgRouterMigrationLock

Function TestOrgRouterMigrationLock

controlplane/migration_lock_test.go:16–36  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

14)
15
16func TestOrgRouterMigrationLock(t *testing.T) {
17 router := &OrgRouter{}
18
19 if router.IsMigrating("org-1") {
20 t.Fatal("expected org-1 to not be migrating initially")
21 }
22
23 router.SetMigrating("org-1")
24 if !router.IsMigrating("org-1") {
25 t.Fatal("expected org-1 to be migrating after SetMigrating")
26 }
27
28 if router.IsMigrating("org-2") {
29 t.Fatal("expected org-2 to not be migrating")
30 }
31
32 router.ClearMigrating("org-1")
33 if router.IsMigrating("org-1") {
34 t.Fatal("expected org-1 to not be migrating after ClearMigrating")
35 }
36}
37
38// newTestActivator creates a SharedWorkerActivator with fake k8s secrets
39// and configurable activation behavior for migration lock testing.

Callers

nothing calls this directly

Calls 3

IsMigratingMethod · 0.95
SetMigratingMethod · 0.95
ClearMigratingMethod · 0.95

Tested by

no test coverage detected