Skip to content

Commit

Permalink
increase max offset for crdb cluster in e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ecordell committed Jan 28, 2022
1 parent eace2dc commit c650c60
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
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

0 comments on commit c650c60

Please sign in to comment.