Skip to content

Commit da6767a

Browse files
committed
Check that subChanges was successful from BlipTesterClient
1 parent a3905e9 commit da6767a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

rest/utilities_testing_blip_client.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1431,7 +1431,6 @@ func (btc *BlipTesterCollectionClient) StartPullSince(options BlipTesterPullOpti
14311431
if options.RequestPlus {
14321432
subChangesRequest.Properties[db.SubChangesRequestPlus] = "true"
14331433
}
1434-
subChangesRequest.SetNoReply(true)
14351434

14361435
if btc.parent.BlipTesterClientOpts.SendRevocations {
14371436
subChangesRequest.Properties[db.SubChangesRevocations] = "true"
@@ -1449,6 +1448,16 @@ func (btc *BlipTesterCollectionClient) StartPullSince(options BlipTesterPullOpti
14491448
))
14501449
}
14511450
btc.sendPullMsg(subChangesRequest)
1451+
1452+
// ensure subChanges was successful
1453+
subChangesResponse := subChangesRequest.Response()
1454+
rspBody, err := subChangesResponse.Body()
1455+
require.NoError(btc.TB(), err)
1456+
errorDomain := subChangesResponse.Properties["Error-Domain"]
1457+
errorCode := subChangesResponse.Properties["Error-Code"]
1458+
if errorDomain != "" && errorCode != "" {
1459+
require.FailNowf(btc.TB(), "error %s %s from subChanges with body: %s", errorDomain, errorCode, string(rspBody))
1460+
}
14521461
}
14531462

14541463
func (btc *BlipTesterCollectionClient) StopPush() {

0 commit comments

Comments
 (0)