Skip to content

Commit

Permalink
kv: resolve merge skew in TestResolveIntentWithTargetBytes
Browse files Browse the repository at this point in the history
Resolves merge skew between cockroachdb#94814 and cockroachdb#94698.

Release note: None
Epic: None
  • Loading branch information
nvanbenschoten committed Jan 12, 2023
1 parent 53f29d4 commit b6b9be7
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 b6b9be7

Please sign in to comment.