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

Function TestGrpcCompressionSupport

dgraph/cmd/alpha/run_test.go:1313–1329  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1311}
1312
1313func TestGrpcCompressionSupport(t *testing.T) {
1314 conn, err := grpc.NewClient(alphaSockAdd,
1315 grpc.WithTransportCredentials(insecure.NewCredentials()),
1316 grpc.WithDefaultCallOptions(grpc.UseCompressor(gzip.Name)),
1317 )
1318 defer func() {
1319 require.NoError(t, conn.Close())
1320 }()
1321 require.NoError(t, err)
1322
1323 dc := dgo.NewDgraphClient(api.NewDgraphClient(conn))
1324 require.NoError(t, dc.LoginIntoNamespace(context.Background(), x.GrootId, "password", x.RootNamespace))
1325 q := `schema {}`
1326 tx := dc.NewTxn()
1327 _, err = tx.Query(context.Background(), q)
1328 require.NoError(t, err)
1329}
1330
1331func TestTypeMutationAndQuery(t *testing.T) {
1332 var m = `

Callers

nothing calls this directly

Calls 3

LoginIntoNamespaceMethod · 0.80
CloseMethod · 0.65
QueryMethod · 0.45

Tested by

no test coverage detected