MCPcopy
hub / github.com/dgraph-io/dgraph / TestDropNamespaceErr

Function TestDropNamespaceErr

edgraph/namespace_test.go:104–129  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

102}
103
104func TestDropNamespaceErr(t *testing.T) {
105 dc := dgraphtest.NewComposeCluster()
106 client, cleanup, err := dc.Client()
107 require.NoError(t, err)
108 defer cleanup()
109
110 // Drop all data
111 require.NoError(t, client.Login(context.Background(),
112 dgraphapi.DefaultUser, dgraphapi.DefaultPassword))
113 require.NoError(t, client.DropAll())
114
115 // Wait for DropAll to complete (async operation)
116 waitForNamespaceCount(t, client, 1, 30*time.Second)
117
118 // create ns1
119 ctx := context.Background()
120 ns1, err := client.CreateNamespace(ctx)
121 require.NoError(t, err)
122
123 // Dropping a non-existent namespace should not be an error
124 require.NoError(t, client.DropNamespace(ctx, ns1))
125 require.NoError(t, client.DropNamespace(ctx, uint64(10000000)))
126
127 // Wait for DropNamespace to complete (async operation)
128 waitForNamespaceCount(t, client, 1, 30*time.Second)
129}

Callers

nothing calls this directly

Calls 8

ClientMethod · 0.95
NewComposeClusterFunction · 0.92
cleanupFunction · 0.85
waitForNamespaceCountFunction · 0.85
LoginMethod · 0.80
DropAllMethod · 0.80
CreateNamespaceMethod · 0.80
DropNamespaceMethod · 0.80

Tested by

no test coverage detected