MCPcopy Create free account
hub / github.com/dgraph-io/dgraph / TestIdLeaseOverflow

Function TestIdLeaseOverflow

dgraph/cmd/zero/zero_test.go:43–55  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

41}
42
43func TestIdLeaseOverflow(t *testing.T) {
44 dialOpts := []grpc.DialOption{grpc.WithTransportCredentials(insecure.NewCredentials())}
45 con, err := grpc.NewClient(testutil.GetSockAddrZero(), dialOpts...)
46 require.NoError(t, err)
47 zc := pb.NewZeroClient(con)
48
49 _, err = zc.AssignIds(context.Background(), &pb.Num{Val: 100, Type: pb.Num_UID})
50 require.NoError(t, err)
51
52 _, err = zc.AssignIds(context.Background(), &pb.Num{Val: math.MaxUint64 - 10, Type: pb.Num_UID})
53 require.Error(t, err)
54 require.Contains(t, err.Error(), "limit has reached")
55}
56
57func TestIdBump(t *testing.T) {
58 dialOpts := []grpc.DialOption{grpc.WithTransportCredentials(insecure.NewCredentials())}

Callers

nothing calls this directly

Calls 4

AssignIdsMethod · 0.95
GetSockAddrZeroFunction · 0.92
NewZeroClientFunction · 0.92
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…