Skip to content

Do not error when getting stats #7307

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 20, 2025
Merged
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
8 changes: 4 additions & 4 deletions rest/utilities_testing_blip_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1007,11 +1007,11 @@ func (btcRunner *BlipTestClientRunner) NewBlipTesterClientOptsWithRT(rt *RestTes
if !opts.AllowCreationWithoutBlipTesterClientRunner && !btcRunner.initialisedInsideRunnerCode {
require.FailNow(btcRunner.TB(), "must initialise BlipTesterClient inside Run() method")
}
if opts.SourceID == "" {
opts.SourceID = "blipclient"
}
id, err := uuid.NewRandom()
require.NoError(btcRunner.TB(), err)
if opts.SourceID == "" {
opts.SourceID = fmt.Sprintf("btc-%d", id.ID())
}

client = &BlipTesterClient{
BlipTesterClientOpts: *opts,
Expand Down Expand Up @@ -1561,7 +1561,7 @@ func (btc *BlipTesterCollectionClient) upsertDoc(docID string, parentVersion *Do
var docVersion DocVersion
if btc.UseHLV() {
// TODO: CBG-4440 Construct a HLC for Value - UnixNano is not accurate enough on Windows to generate unique values, and seq is not comparable across clients.
newVersion := db.Version{SourceID: fmt.Sprintf("btc-%d", btc.parent.id), Value: uint64(time.Now().UnixNano())}
newVersion := db.Version{SourceID: btc.parent.SourceID, Value: uint64(time.Now().UnixNano())}
require.NoError(btc.TB(), hlv.AddVersion(newVersion))
docVersion = DocVersion{CV: *hlv.ExtractCurrentVersionFromHLV()}
} else {
Expand Down
2 changes: 1 addition & 1 deletion topologytest/couchbase_lite_mock_peer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ func (p *CouchbaseLiteMockPeer) CreateReplication(peer Peer, config PeerReplicat
Channels: []string{"*"},
SupportedBLIPProtocols: []string{db.CBMobileReplicationV4.SubprotocolString()},
AllowCreationWithoutBlipTesterClientRunner: true,
SourceID: peer.SourceID(),
SourceID: p.SourceID(),
},
)
p.blipClients[sg.String()] = &PeerBlipTesterClient{
Expand Down
4 changes: 3 additions & 1 deletion topologytest/couchbase_server_peer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ func (r *CouchbaseServerReplication) String() string {

func (r *CouchbaseServerReplication) Stats() string {
stats, err := r.manager.Stats(r.ctx)
require.NoError(r.t, err)
if err != nil {
return fmt.Sprintf("error getting stats: %v", err)
}
return fmt.Sprintf("%+v", *stats)
}

Expand Down
11 changes: 0 additions & 11 deletions topologytest/multi_actor_conflict_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,13 @@ package topologytest
import (
"strings"
"testing"

"github.com/couchbase/sync_gateway/base"
)

// TestMultiActorConflictCreate
// 1. create document on each peer with different contents
// 2. start replications
// 3. wait for documents to exist with hlv sources equal to the number of active peers
func TestMultiActorConflictCreate(t *testing.T) {
if !base.UnitTestUrlIsWalrus() {
t.Skip("Flakey failures on multi actor conflicting writes, CBG-4379")
}
for _, topology := range append(simpleTopologies, Topologies...) {
t.Run(topology.description, func(t *testing.T) {
collectionName, peers, replications := setupTests(t, topology)
Expand All @@ -46,9 +41,6 @@ func TestMultiActorConflictCreate(t *testing.T) {
// 6. start replications
// 7. assert that the documents are deleted on all peers and have hlv sources equal to the number of active peers
func TestMultiActorConflictUpdate(t *testing.T) {
if !base.UnitTestUrlIsWalrus() {
t.Skip("Flakey failures on multi actor conflicting writes, CBG-4379")
}
for _, topology := range append(simpleTopologies, Topologies...) {
if strings.Contains(topology.description, "CBL") {
t.Skip("CBL actor can generate conflicts and push replication fails with conflict for doc in blip tester CBL-4267")
Expand Down Expand Up @@ -117,9 +109,6 @@ func TestMultiActorConflictDelete(t *testing.T) {
// 10. start replications
// 11. assert that the documents are resurrected on all peers and have hlv sources equal to the number of active peers and the document body is equivalent to the last write
func TestMultiActorConflictResurrect(t *testing.T) {
if !base.UnitTestUrlIsWalrus() {
t.Skip("Flakey failures on multi actor conflicting writes, CBG-4379")
}
for _, topology := range append(simpleTopologies, Topologies...) {
if strings.Contains(topology.description, "CBL") {
t.Skip("CBL actor can generate conflicts and push replication fails with conflict for doc in blip tester CBL-4267")
Expand Down
5 changes: 0 additions & 5 deletions topologytest/multi_actor_no_conflict_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ package topologytest
import (
"fmt"
"testing"

"github.com/couchbase/sync_gateway/base"
)

// TestMultiActorUpdate tests that a single actor can update a document that was created on a different peer.
Expand Down Expand Up @@ -78,9 +76,6 @@ func TestMultiActorDelete(t *testing.T) {
// 6. resurrect each document on a single peer
// 7. wait for the hlv for updated documents to be synchronized
func TestMultiActorResurrect(t *testing.T) {
if base.UnitTestUrlIsWalrus() {
t.Skip("CBG-4419: this test fails xdcr with: could not write doc: cas mismatch: expected 0, really 1 -- xdcr.(*rosmarManager).processEvent() at rosmar_xdcr.go:201")
}
for _, topology := range append(simpleTopologies, Topologies...) {
t.Run(topology.description, func(t *testing.T) {
collectionName, peers, replications := setupTests(t, topology)
Expand Down
Loading