Skip to content

Commit

Permalink
storage: Fix CI Failures Due To MVCCGet Assignment Mismatch
Browse files Browse the repository at this point in the history
Informs: cockroachdb#77228

cmd_resolve_intent_test.go calls MVCCGet, which originally
returned 3 values, but in cockroachdb#94698, returns 2 values (MVCCGetResult).
Unfortunately, the PR containing changes to cmd_resolve_intent_test.go
used the original MVCCGet with 3 return values and was merged at
around the same time as the change to MVCCGet, and the changes to
cmd_resolve_intent_test.go calling the original MVCCGet with 3
return values was merged, which causes CI failures after the change
to MVCCGet from 3 to 2 return values was also merged as is.

Release note: None
  • Loading branch information
KaiSun314 committed Jan 12, 2023
1 parent f62b59f commit 06fc152
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions pkg/kv/kvserver/batcheval/cmd_resolve_intent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ func TestResolveIntentWithTargetBytes(t *testing.T) {
numBytes := batch.Len()
require.Equal(t, numBytes, initialBytes)

_, _, err = storage.MVCCGet(ctx, batch, testKeys[0], ts, storage.MVCCGetOptions{})
_, err = storage.MVCCGet(ctx, batch, testKeys[0], ts, storage.MVCCGetOptions{})
require.Error(t, err)
}

Expand All @@ -365,10 +365,10 @@ func TestResolveIntentWithTargetBytes(t *testing.T) {
require.Greater(t, numBytes, initialBytes+1000)
require.Less(t, numBytes, initialBytes+1100)

value, _, err := storage.MVCCGet(ctx, batch, testKeys[0], ts, storage.MVCCGetOptions{})
valueRes, err := storage.MVCCGet(ctx, batch, testKeys[0], ts, storage.MVCCGetOptions{})
require.NoError(t, err)
require.Equal(t, values[0].RawBytes, value.RawBytes,
"the value %s in get result does not match the value %s in request", values[0].RawBytes, value.RawBytes)
require.Equal(t, values[0].RawBytes, valueRes.Value.RawBytes,
"the value %s in get result does not match the value %s in request", values[0].RawBytes, valueRes.Value.RawBytes)
}
} else {
// Resolve an intent range for testKeys[0], testKeys[1], ...,
Expand Down Expand Up @@ -404,7 +404,7 @@ func TestResolveIntentWithTargetBytes(t *testing.T) {
numBytes := batch.Len()
require.Equal(t, numBytes, initialBytes)

_, _, err = storage.MVCCGet(ctx, batch, testKeys[0], ts, storage.MVCCGetOptions{})
_, err = storage.MVCCGet(ctx, batch, testKeys[0], ts, storage.MVCCGetOptions{})
require.Error(t, err)
}

Expand Down Expand Up @@ -434,11 +434,11 @@ func TestResolveIntentWithTargetBytes(t *testing.T) {
require.Greater(t, numBytes, initialBytes+3000)
require.Less(t, numBytes, initialBytes+3300)

value, _, err := storage.MVCCGet(ctx, batch, testKeys[2], ts, storage.MVCCGetOptions{})
valueRes, err := storage.MVCCGet(ctx, batch, testKeys[2], ts, storage.MVCCGetOptions{})
require.NoError(t, err)
require.Equal(t, values[2].RawBytes, value.RawBytes,
"the value %s in get result does not match the value %s in request", values[2].RawBytes, value.RawBytes)
_, _, err = storage.MVCCGet(ctx, batch, testKeys[3], ts, storage.MVCCGetOptions{})
require.Equal(t, values[2].RawBytes, valueRes.Value.RawBytes,
"the value %s in get result does not match the value %s in request", values[2].RawBytes, valueRes.Value.RawBytes)
_, err = storage.MVCCGet(ctx, batch, testKeys[3], ts, storage.MVCCGetOptions{})
require.Error(t, err)
}

Expand Down Expand Up @@ -468,10 +468,10 @@ func TestResolveIntentWithTargetBytes(t *testing.T) {
require.Greater(t, numBytes, initialBytes+5000)
require.Less(t, numBytes, initialBytes+5500)

value, _, err := storage.MVCCGet(ctx, batch, testKeys[nKeys-1], ts, storage.MVCCGetOptions{})
valueRes, err := storage.MVCCGet(ctx, batch, testKeys[nKeys-1], ts, storage.MVCCGetOptions{})
require.NoError(t, err)
require.Equal(t, values[nKeys-1].RawBytes, value.RawBytes,
"the value %s in get result does not match the value %s in request", values[nKeys-1].RawBytes, value.RawBytes)
require.Equal(t, values[nKeys-1].RawBytes, valueRes.Value.RawBytes,
"the value %s in get result does not match the value %s in request", values[nKeys-1].RawBytes, valueRes.Value.RawBytes)
}
}
})
Expand Down

0 comments on commit 06fc152

Please sign in to comment.