-
Notifications
You must be signed in to change notification settings - Fork 3.8k
/
cmd_barrier_test.go
43 lines (35 loc) · 1.24 KB
/
cmd_barrier_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright 2024 The Cockroach Authors.
//
// Use of this software is governed by the Business Source License
// included in the file licenses/BSL.txt.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by the Apache License, Version 2.0, included in the file
// licenses/APL.txt.
package batcheval_test
import (
"context"
"testing"
"github.com/cockroachdb/cockroach/pkg/base"
"github.com/cockroachdb/cockroach/pkg/testutils/serverutils"
"github.com/cockroachdb/cockroach/pkg/util/leaktest"
"github.com/cockroachdb/cockroach/pkg/util/log"
"github.com/stretchr/testify/require"
)
func TestBarrier(t *testing.T) {
defer leaktest.AfterTest(t)()
defer log.Scope(t).Close(t)
ctx := context.Background()
srv, _, kvDB := serverutils.StartServer(t, base.TestServerArgs{})
defer srv.Stopper().Stop(ctx)
tsrv := srv.ApplicationLayer()
start := append(tsrv.Codec().TenantPrefix(), []byte("/a")...)
end := append(tsrv.Codec().TenantPrefix(), []byte("/b")...)
// TODO(erikgrinaker): add some actual testing here.
ts, lai, err := kvDB.Barrier(ctx, start, end)
require.NoError(t, err)
require.NotZero(t, ts)
require.NotZero(t, lai)
t.Logf("ts=%s lai=%d", ts, lai)
}