Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

increase max offset for crdb cluster in e2e tests #389

Merged
merged 1 commit into from
Jan 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions e2e/cockroach/cockroach.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ import (

// Node represents a single cockroachdb instance
type Node struct {
Peers []string
Addr string
Httpaddr string
ID string
Peers []string
Addr string
Httpaddr string
ID string
MaxOffset time.Duration
// only available after Start()
pid int
conn *pgx.Conn
Expand All @@ -42,6 +43,7 @@ func (c *Node) Start(ctx context.Context) error {
"--listen-addr=" + c.Addr,
"--http-addr=" + c.Httpaddr,
"--join=" + strings.Join(c.Peers, ","),
"--max-offset=" + c.MaxOffset.String(),
}

c.pid, err = e2e.GoRun(ctx, logfile, logfile, cmd...)
Expand Down Expand Up @@ -112,9 +114,10 @@ func NewCluster(n int) Cluster {
addr := net.JoinHostPort("localhost", strconv.Itoa(port+i))
peers = append(peers, addr)
cs = append(cs, &Node{
ID: strconv.Itoa(i + 1),
Addr: addr,
Httpaddr: net.JoinHostPort("localhost", strconv.Itoa(http+i)),
ID: strconv.Itoa(i + 1),
Addr: addr,
Httpaddr: net.JoinHostPort("localhost", strconv.Itoa(http+i)),
MaxOffset: 5 * time.Second,
})
}
for i := range cs {
Expand Down
4 changes: 2 additions & 2 deletions e2e/newenemy/newenemy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func TestNoNewEnemy(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
vulnerableFn, protectedFn := attemptFnsForProbeFns(100, tt.vulnerableProbe, tt.protectedProbe)
vulnerableFn, protectedFn := attemptFnsForProbeFns(20, tt.vulnerableProbe, tt.protectedProbe)
statTest(t, 5, vulnerableFn, protectedFn)
})
}
Expand Down Expand Up @@ -302,7 +302,7 @@ func iterationsForHighConfidence(samples []int) (iterations int) {
func checkDataNoNewEnemy(ctx context.Context, t testing.TB, schemaData []SchemaData, slowNodeId int, crdb cockroach.Cluster, spicedb spice.Cluster, maxAttempts int) (bool, int) {
prefix := prefixForNode(ctx, crdb[1].Conn(), schemaData, slowNodeId)
t.Log("filling with data to span multiple ranges for prefix", prefix)
fill(t, spicedb[0].Client().V0().ACL(), prefix, 4000, 1000)
fill(t, spicedb[0].Client().V0().ACL(), prefix, 500, 100)

for attempts := 1; attempts <= maxAttempts; attempts++ {
direct, exclude := generateTuple(prefix, objIdGenerator)
Expand Down