@@ -104,44 +104,38 @@ func removeSyncGatewayBackingPeers(peers map[string]Peer) map[string]bool {
104
104
// It is not known at this stage which write the "winner" will be, since conflict resolution can happen at replication time which may not be LWW, or may be LWW but with a new value.
105
105
func createConflictingDocs (t * testing.T , dsName base.ScopeAndCollectionName , peers Peers , docID , topologyDescription string ) {
106
106
backingPeers := removeSyncGatewayBackingPeers (peers )
107
- documentVersion := make ([]BodyAndVersion , 0 , len (peers ))
108
107
for peerName , peer := range peers {
109
108
if backingPeers [peerName ] {
110
109
continue
111
110
}
112
111
docBody := []byte (fmt .Sprintf (`{"activePeer": "%s", "topology": "%s", "action": "create"}` , peerName , topologyDescription ))
113
112
docVersion := peer .CreateDocument (dsName , docID , docBody )
114
113
t .Logf ("%s - createVersion: %#v" , peerName , docVersion .docMeta )
115
- documentVersion = append (documentVersion , docVersion )
116
114
}
117
115
}
118
116
119
117
// updateConflictingDocs will update a doc on each peer of the same doc ID to create conflicting document mutations
120
118
func updateConflictingDocs (t * testing.T , dsName base.ScopeAndCollectionName , peers Peers , docID , topologyDescription string ) {
121
119
backingPeers := removeSyncGatewayBackingPeers (peers )
122
- var documentVersion []BodyAndVersion
123
120
for peerName , peer := range peers {
124
121
if backingPeers [peerName ] {
125
122
continue
126
123
}
127
124
docBody := []byte (fmt .Sprintf (`{"activePeer": "%s", "topology": "%s", "action": "update"}` , peerName , topologyDescription ))
128
125
docVersion := peer .WriteDocument (dsName , docID , docBody )
129
126
t .Logf ("updateVersion: %#v" , docVersion .docMeta )
130
- documentVersion = append (documentVersion , docVersion )
131
127
}
132
128
}
133
129
134
130
// deleteConflictDocs will delete a doc on each peer of the same doc ID to create conflicting document deletions
135
131
func deleteConflictDocs (t * testing.T , dsName base.ScopeAndCollectionName , peers Peers , docID string ) {
136
132
backingPeers := removeSyncGatewayBackingPeers (peers )
137
- var documentVersion []BodyAndVersion
138
133
for peerName , peer := range peers {
139
134
if backingPeers [peerName ] {
140
135
continue
141
136
}
142
137
deleteVersion := peer .DeleteDocument (dsName , docID )
143
138
t .Logf ("deleteVersion: %#v" , deleteVersion )
144
- documentVersion = append (documentVersion , BodyAndVersion {docMeta : deleteVersion , updatePeer : peerName })
145
139
}
146
140
}
147
141
0 commit comments