mirror of
https://github.com/restic/restic.git
synced 2026-09-03 11:17:14 +00:00
Update dependencies
Among others, this updates minio-go, so that the new "eu-west-3" zone for AWS is supported.
This commit is contained in:
+48
-19
@@ -20,7 +20,6 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"reflect"
|
||||
"sync/atomic"
|
||||
"testing"
|
||||
"time"
|
||||
@@ -588,10 +587,10 @@ nextTest:
|
||||
}
|
||||
rows = append(rows, rs...)
|
||||
}
|
||||
if !reflect.DeepEqual(p.ts, test.wantTs) {
|
||||
if !testEqual(p.ts, test.wantTs) {
|
||||
t.Errorf("got transaction(%v), want %v", p.ts, test.wantTs)
|
||||
}
|
||||
if !reflect.DeepEqual(rows, test.wantF) {
|
||||
if !testEqual(rows, test.wantF) {
|
||||
t.Errorf("test %d: rows=\n%v\n; want\n%v\n; p.row:\n%v\n", i, describeRows(rows), describeRows(test.wantF), p.row)
|
||||
}
|
||||
if got := p.done(); got != test.wantD {
|
||||
@@ -840,13 +839,13 @@ nextTest:
|
||||
if stateDone {
|
||||
// Check if resumableStreamDecoder carried out expected
|
||||
// state transitions.
|
||||
if !reflect.DeepEqual(st, test.stateHistory) {
|
||||
if !testEqual(st, test.stateHistory) {
|
||||
t.Errorf("%v: observed state transitions: \n%v\n, want \n%v\n",
|
||||
test.name, st, test.stateHistory)
|
||||
}
|
||||
// Check if resumableStreamDecoder returns expected array of
|
||||
// PartialResultSets.
|
||||
if !reflect.DeepEqual(rs, test.want) {
|
||||
if !testEqual(rs, test.want) {
|
||||
t.Errorf("%v: received PartialResultSets: \n%v\n, want \n%v\n", test.name, rs, test.want)
|
||||
}
|
||||
// Verify that resumableStreamDecoder's internal buffering is also correct.
|
||||
@@ -858,15 +857,15 @@ nextTest:
|
||||
}
|
||||
q = append(q, item)
|
||||
}
|
||||
if !reflect.DeepEqual(q, test.queue) {
|
||||
if !testEqual(q, test.queue) {
|
||||
t.Errorf("%v: PartialResultSets still queued: \n%v\n, want \n%v\n", test.name, q, test.queue)
|
||||
}
|
||||
// Verify resume token.
|
||||
if test.resumeToken != nil && !reflect.DeepEqual(r.resumeToken, test.resumeToken) {
|
||||
if test.resumeToken != nil && !testEqual(r.resumeToken, test.resumeToken) {
|
||||
t.Errorf("%v: Resume token is %v, want %v\n", test.name, r.resumeToken, test.resumeToken)
|
||||
}
|
||||
// Verify error message.
|
||||
if !reflect.DeepEqual(lastErr, test.wantErr) {
|
||||
if !testEqual(lastErr, test.wantErr) {
|
||||
t.Errorf("%v: got error %v, want %v", test.name, lastErr, test.wantErr)
|
||||
}
|
||||
// Proceed to next test
|
||||
@@ -1120,25 +1119,25 @@ func TestRsdBlockingStates(t *testing.T) {
|
||||
case <-stateDone: // Note that at this point, receiver is still blocking on r.next().
|
||||
// Check if resumableStreamDecoder carried out expected
|
||||
// state transitions.
|
||||
if !reflect.DeepEqual(st, test.stateHistory) {
|
||||
if !testEqual(st, test.stateHistory) {
|
||||
t.Errorf("%v: observed state transitions: \n%v\n, want \n%v\n",
|
||||
test.name, st, test.stateHistory)
|
||||
}
|
||||
// Check if resumableStreamDecoder returns expected array of
|
||||
// PartialResultSets.
|
||||
if !reflect.DeepEqual(rs, test.want) {
|
||||
if !testEqual(rs, test.want) {
|
||||
t.Errorf("%v: received PartialResultSets: \n%v\n, want \n%v\n", test.name, rs, test.want)
|
||||
}
|
||||
// Verify that resumableStreamDecoder's internal buffering is also correct.
|
||||
if !reflect.DeepEqual(q, test.queue) {
|
||||
if !testEqual(q, test.queue) {
|
||||
t.Errorf("%v: PartialResultSets still queued: \n%v\n, want \n%v\n", test.name, q, test.queue)
|
||||
}
|
||||
// Verify resume token.
|
||||
if test.resumeToken != nil && !reflect.DeepEqual(r.resumeToken, test.resumeToken) {
|
||||
if test.resumeToken != nil && !testEqual(r.resumeToken, test.resumeToken) {
|
||||
t.Errorf("%v: Resume token is %v, want %v\n", test.name, r.resumeToken, test.resumeToken)
|
||||
}
|
||||
// Verify error message.
|
||||
if !reflect.DeepEqual(lastErr, test.wantErr) {
|
||||
if !testEqual(lastErr, test.wantErr) {
|
||||
t.Errorf("%v: got error %v, want %v", test.name, lastErr, test.wantErr)
|
||||
}
|
||||
case <-time.After(1 * time.Second):
|
||||
@@ -1340,7 +1339,7 @@ func TestResumeToken(t *testing.T) {
|
||||
},
|
||||
},
|
||||
}
|
||||
if !reflect.DeepEqual(rows, want) {
|
||||
if !testEqual(rows, want) {
|
||||
t.Errorf("received rows: \n%v\n; but want\n%v\n", rows, want)
|
||||
}
|
||||
// Inject resumable failure.
|
||||
@@ -1365,7 +1364,7 @@ func TestResumeToken(t *testing.T) {
|
||||
{Kind: &proto3.Value_StringValue{StringValue: valStr(2)}},
|
||||
},
|
||||
})
|
||||
if !reflect.DeepEqual(rows, want) {
|
||||
if !testEqual(rows, want) {
|
||||
t.Errorf("received rows: \n%v\n, want\n%v\n", rows, want)
|
||||
}
|
||||
// Sending 3rd - (maxBuffers+1)th rows without resume tokens, client should buffer them.
|
||||
@@ -1376,7 +1375,7 @@ func TestResumeToken(t *testing.T) {
|
||||
t.Fatalf("failed to wait for row 3-%v: %v", maxBuffers+1, err)
|
||||
}
|
||||
// Received rows should be unchanged.
|
||||
if !reflect.DeepEqual(rows, want) {
|
||||
if !testEqual(rows, want) {
|
||||
t.Errorf("receive rows: \n%v\n, want\n%v\n", rows, want)
|
||||
}
|
||||
// Send (maxBuffers+2)th row to trigger state change of resumableStreamDecoder:
|
||||
@@ -1396,7 +1395,7 @@ func TestResumeToken(t *testing.T) {
|
||||
},
|
||||
})
|
||||
}
|
||||
if !reflect.DeepEqual(rows, want) {
|
||||
if !testEqual(rows, want) {
|
||||
t.Errorf("received rows: \n%v\n; want\n%v\n", rows, want)
|
||||
}
|
||||
// Inject resumable error, but since resumableStreamDecoder is already at queueingUnretryable
|
||||
@@ -1411,7 +1410,7 @@ func TestResumeToken(t *testing.T) {
|
||||
case <-time.After(10 * time.Second):
|
||||
t.Fatalf("timeout in waiting for failed query to return.")
|
||||
}
|
||||
if wantErr := toSpannerError(grpc.Errorf(codes.Unavailable, "mock server wants some sleep")); !reflect.DeepEqual(gotErr, wantErr) {
|
||||
if wantErr := toSpannerError(grpc.Errorf(codes.Unavailable, "mock server wants some sleep")); !testEqual(gotErr, wantErr) {
|
||||
t.Fatalf("stream() returns error: %v, but want error: %v", gotErr, wantErr)
|
||||
}
|
||||
|
||||
@@ -1455,7 +1454,7 @@ func TestResumeToken(t *testing.T) {
|
||||
},
|
||||
},
|
||||
}
|
||||
if !reflect.DeepEqual(rows, want) {
|
||||
if !testEqual(rows, want) {
|
||||
t.Errorf("received rows: \n%v\n; but want\n%v\n", rows, want)
|
||||
}
|
||||
}
|
||||
@@ -1647,6 +1646,36 @@ func TestRowIteratorDo(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestRowIteratorDoWithError(t *testing.T) {
|
||||
restore := setMaxBytesBetweenResumeTokens()
|
||||
defer restore()
|
||||
ms := testutil.NewMockCloudSpanner(t, trxTs)
|
||||
ms.Serve()
|
||||
defer ms.Stop()
|
||||
cc := dialMock(t, ms)
|
||||
defer cc.Close()
|
||||
mc := sppb.NewSpannerClient(cc)
|
||||
|
||||
for i := 0; i < 3; i++ {
|
||||
ms.AddMsg(nil, false)
|
||||
}
|
||||
ms.AddMsg(io.EOF, true)
|
||||
iter := stream(context.Background(),
|
||||
func(ct context.Context, resumeToken []byte) (streamingReceiver, error) {
|
||||
return mc.ExecuteStreamingSql(ct, &sppb.ExecuteSqlRequest{
|
||||
Sql: "SELECT t.key key, t.value value FROM t_mock t",
|
||||
ResumeToken: resumeToken,
|
||||
})
|
||||
},
|
||||
nil,
|
||||
func(error) {})
|
||||
injected := errors.New("Failed iterator")
|
||||
err := iter.Do(func(r *Row) error { return injected })
|
||||
if err != injected {
|
||||
t.Errorf("got <%v>, want <%v>", err, injected)
|
||||
}
|
||||
}
|
||||
|
||||
func TestIteratorStopEarly(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
restore := setMaxBytesBetweenResumeTokens()
|
||||
|
||||
Reference in New Issue
Block a user