Skip to content
Open
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
15 changes: 5 additions & 10 deletions rest/access_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -806,15 +806,11 @@ func TestChannelAccessChanges(t *testing.T) {
assert.Equal(t, "g1", changes.Results[0].ID)

// Look up sequences for created docs
deltaGrantDocSeq, err := rt.SequenceForDoc("delta")
assert.NoError(t, err, "Error retrieving document sequence")
gammaGrantDocSeq, err := rt.SequenceForDoc("gamma")
assert.NoError(t, err, "Error retrieving document sequence")
deltaGrantDocSeq := rt.SequenceForDoc("delta")
gammaGrantDocSeq := rt.SequenceForDoc("gamma")

alphaDocSeq, err := rt.SequenceForDoc("a1")
assert.NoError(t, err, "Error retrieving document sequence")
gammaDocSeq, err := rt.SequenceForDoc("g1")
assert.NoError(t, err, "Error retrieving document sequence")
alphaDocSeq := rt.SequenceForDoc("a1")
gammaDocSeq := rt.SequenceForDoc("g1")

// Check user access:
alice, _ = a.GetUser("alice")
Expand Down Expand Up @@ -843,8 +839,7 @@ func TestChannelAccessChanges(t *testing.T) {
response = rt.SendRequest(http.MethodPut, "/{{.keyspace}}/alpha", str)
RequireStatus(t, response, http.StatusCreated)

alphaGrantDocSeq, err := rt.SequenceForDoc("alpha")
assert.NoError(t, err, "Error retrieving document sequence")
alphaGrantDocSeq := rt.SequenceForDoc("alpha")

// Check user access again:
alice, _ = a.GetUser("alice")
Expand Down
3 changes: 1 addition & 2 deletions rest/adminapitest/admin_api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,7 @@ func TestDBOfflineConcurrent(t *testing.T) {
wg.Done()
}()

err := rest.WaitWithTimeout(&wg, time.Second*30)
assert.NoError(t, err, "Error waiting for waitgroup")
rest.WaitWithTimeout(t, &wg, time.Second*30)
rest.RequireStatus(t, goroutineresponse1, http.StatusOK)
rest.RequireStatus(t, goroutineresponse2, http.StatusOK)

Expand Down
2 changes: 1 addition & 1 deletion rest/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2052,7 +2052,7 @@ func TestWebhookProperties(t *testing.T) {
assert.NoError(t, err)
}

require.NoError(t, WaitWithTimeout(&wg, 30*time.Second))
WaitWithTimeout(t, &wg, 30*time.Second)
}

func TestWebhookSpecialProperties(t *testing.T) {
Expand Down
11 changes: 3 additions & 8 deletions rest/attachment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2464,9 +2464,7 @@ func TestProveAttachmentNotFound(t *testing.T) {
}

// Initial set up
sent, _, _, err := bt.SendRev("doc1", "1-abc", []byte(`{"key": "val", "_attachments": {"attachment": {"data": "`+attachmentDataEncoded+`"}}}`), blip.Properties{})
require.True(t, sent)
require.NoError(t, err)
bt.SendRev("doc1", "1-abc", []byte(`{"key": "val", "_attachments": {"attachment": {"data": "`+attachmentDataEncoded+`"}}}`), blip.Properties{})

rt.WaitForPendingChanges()

Expand All @@ -2476,9 +2474,7 @@ func TestProveAttachmentNotFound(t *testing.T) {

// Use different attachment name to bypass digest check in ForEachStubAttachment() which skips prove attachment code
// Set attachment to V2 so it can be retrieved by RT successfully
sent, _, _, err = bt.SendRev("doc1", "2-abc", []byte(`{"key": "val", "_attachments":{"attach":{"digest":"sha1-wzp8ZyykdEuZ9GuqmxQ7XDrY7Co=","length":11,"stub":true,"revpos":1,"ver":2}}}`), blip.Properties{})
require.True(t, sent)
require.NoError(t, err)
bt.SendRev("doc1", "2-abc", []byte(`{"key": "val", "_attachments":{"attach":{"digest":"sha1-wzp8ZyykdEuZ9GuqmxQ7XDrY7Co=","length":11,"stub":true,"revpos":1,"ver":2}}}`), blip.Properties{})

rt.WaitForPendingChanges()
// Check attachment is on the document
Expand Down Expand Up @@ -2550,8 +2546,7 @@ func TestPutInvalidAttachment(t *testing.T) {
attachmentBody: test.invalidAttachmentBody,
attachmentDigest: digest,
}
sent, _, resp := bt.SendRevWithAttachment(input)
assert.True(t, sent)
resp := bt.SendRevWithAttachment(input)

// Make sure we get the expected response back
assert.Equal(t, test.expectedType, resp.Type())
Expand Down
4 changes: 2 additions & 2 deletions rest/blip_api_attachment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,8 +472,8 @@ func TestPutAttachmentViaBlipGetViaBlip(t *testing.T) {
attachmentBody: attachmentBody,
attachmentDigest: digest,
}
sent, _, _ := bt.SendRevWithAttachment(input)
assert.True(t, sent)
resp := bt.SendRevWithAttachment(input)
require.NotContains(t, resp.Properties, "Error-Code")

// Get all docs and attachment via subChanges request
allDocs := bt.WaitForNumDocsViaChanges(1)
Expand Down
Loading
Loading