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

roachtest: fix one-off in version-upgrade #47201

Merged
merged 2 commits into from
Apr 8, 2020
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
7 changes: 3 additions & 4 deletions pkg/cmd/roachtest/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ import (
)

// runNetworkSanity is just a sanity check to make sure we're setting up toxiproxy
// correctly.
// correctly. It injects latency between the nodes and verifies that we're not
// seeing the latency on the client connection running `SELECT 1` on each node.
func runNetworkSanity(ctx context.Context, t *test, origC *cluster, nodes int) {
origC.Put(ctx, cockroach, "./cockroach", origC.All())
c, err := Toxify(ctx, origC, origC.All())
Expand All @@ -41,8 +42,6 @@ func runNetworkSanity(ctx context.Context, t *test, origC *cluster, nodes int) {
// the upstream connections aren't affected by latency below, but the fixed
// cost of starting the binary and processing the query is already close to
// 100ms.
//
// NB: last node gets no latency injected, but first node gets cut off below.
const latency = 300 * time.Millisecond
for i := 1; i <= nodes; i++ {
// NB: note that these latencies only apply to connections *to* the node
Expand Down Expand Up @@ -84,7 +83,7 @@ insert into test.commit values(3,1000), (1,1000), (2,1000);
select age, message from [ show trace for session ];
`)

for i := 1; i < origC.spec.NodeCount; i++ {
for i := 1; i <= origC.spec.NodeCount; i++ {
if dur := c.Measure(ctx, i, `SELECT 1`); dur > latency {
t.Fatalf("node %d unexpectedly affected by latency: select 1 took %.2fs", i, dur.Seconds())
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/roachtest/versionupgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ func waitForUpgradeStep() versionStep {
newVersion := u.binaryVersion(ctx, t, 1).String()
t.l.Printf("%s: waiting for cluster to auto-upgrade\n", newVersion)

for i := 1; i < c.spec.NodeCount; i++ {
for i := 1; i <= c.spec.NodeCount; i++ {
err := retry.ForDuration(30*time.Second, func() error {
db := u.conn(ctx, t, i)

Expand Down