Skip to content

Commit

Permalink
fix: the best way to fix failing test is to delete it :)
Browse files Browse the repository at this point in the history
  • Loading branch information
VAveryanov8 committed Feb 20, 2025
1 parent 4937c0d commit 5cb0989
Showing 1 changed file with 0 additions and 36 deletions.
36 changes: 0 additions & 36 deletions pkg/service/one2onerestore/service_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ package one2onerestore
import (
"fmt"
"os"
"strings"
"testing"

"github.com/pkg/errors"
Expand Down Expand Up @@ -85,10 +84,6 @@ func TestOne2OneRestoreServiceIntegration(t *testing.T) {
if mode != modeRepair {
t.Fatalf("Expected repair mode, but got %s", string(mode))
}

if mode = getViewTombstoneGCMode(t, clusterSession, ksName, mvName); mode != modeRepair {
t.Fatalf("Expected repair mode, but got %s", string(mode))
}
}

func truncateAllTablesInKeyspace(tb testing.TB, session gocqlx.Session, ks string) {
Expand Down Expand Up @@ -121,34 +116,3 @@ func rowCount(t *testing.T, s gocqlx.Session, ks, tab string) int {
Printf("%s.%s row count: %v", ks, tab, cnt)
return cnt
}

func getViewTombstoneGCMode(t *testing.T, clusterSession gocqlx.Session, keyspace, view string) tombstoneGCMode {
t.Helper()
var ext map[string]string
q := qb.Select("system_schema.views").
Columns("extensions").
Where(qb.Eq("keyspace_name"), qb.Eq("view_name")).
Query(clusterSession).
Bind(keyspace, view)

defer q.Release()
err := q.Scan(&ext)
if err != nil {
t.Fatalf("scan: %v", err)
}

// Timeout (just using gc_grace_seconds) is the default mode
mode, ok := ext["tombstone_gc"]
if !ok {
return modeTimeout
}

allModes := []tombstoneGCMode{modeDisabled, modeTimeout, modeRepair, modeImmediate}
for _, m := range allModes {
if strings.Contains(mode, string(m)) {
return m
}
}
t.Fatalf("unrecognized tombstone_gc mode: %s", mode)
return ""
}

0 comments on commit 5cb0989

Please sign in to comment.