Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
OleksiienkoMykyta committed Aug 7, 2024
1 parent 7b90e9f commit e28b00a
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions cassandra_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2240,7 +2240,7 @@ func TestViewMetadata(t *testing.T) {

func TestMaterializedViewMetadata(t *testing.T) {
if flagCassVersion.Before(3, 0, 0) {
return
t.Skip("The Cassandra version is too old")
}
session := createSession(t)
defer session.Close()
Expand All @@ -2259,14 +2259,19 @@ func TestMaterializedViewMetadata(t *testing.T) {
expectedChunkLengthInKB := "16"
expectedDCLocalReadRepairChance := float64(0)
expectedSpeculativeRetry := "99p"
expectedAdditionalWritePolicy := "99p"
expectedReadRepair := "BLOCKING"
if flagCassVersion.Before(4, 0, 0) {
expectedChunkLengthInKB = "64"
expectedDCLocalReadRepairChance = 0.1
expectedSpeculativeRetry = "99PERCENTILE"
expectedReadRepair = ""
expectedAdditionalWritePolicy = ""
}
expectedView1 := MaterializedViewMetadata{
Keyspace: "gocql_test",
Name: "view_view",
AdditionalWritePolicy: expectedAdditionalWritePolicy,
baseTableName: "view_table",
BloomFilterFpChance: 0.01,
Caching: map[string]string{"keys": "ALL", "rows_per_partition": "NONE"},
Expand All @@ -2278,12 +2283,17 @@ func TestMaterializedViewMetadata(t *testing.T) {
DefaultTimeToLive: 0,
Extensions: map[string]string{},
GcGraceSeconds: 864000,
IncludeAllColumns: false, MaxIndexInterval: 2048, MemtableFlushPeriodInMs: 0, MinIndexInterval: 128, ReadRepairChance: 0,
SpeculativeRetry: expectedSpeculativeRetry,
IncludeAllColumns: false, MaxIndexInterval: 2048,
MemtableFlushPeriodInMs: 0,
MinIndexInterval: 128,
ReadRepair: expectedReadRepair,
ReadRepairChance: 0,
SpeculativeRetry: expectedSpeculativeRetry,
}
expectedView2 := MaterializedViewMetadata{
Keyspace: "gocql_test",
Name: "view_view2",
AdditionalWritePolicy: expectedAdditionalWritePolicy,
baseTableName: "view_table2",
BloomFilterFpChance: 0.01,
Caching: map[string]string{"keys": "ALL", "rows_per_partition": "NONE"},
Expand All @@ -2295,8 +2305,13 @@ func TestMaterializedViewMetadata(t *testing.T) {
DefaultTimeToLive: 0,
Extensions: map[string]string{},
GcGraceSeconds: 864000,
IncludeAllColumns: false, MaxIndexInterval: 2048, MemtableFlushPeriodInMs: 0, MinIndexInterval: 128, ReadRepairChance: 0,
SpeculativeRetry: expectedSpeculativeRetry,
IncludeAllColumns: false,
MaxIndexInterval: 2048,
MemtableFlushPeriodInMs: 0,
MinIndexInterval: 128,
ReadRepair: expectedReadRepair,
ReadRepairChance: 0,
SpeculativeRetry: expectedSpeculativeRetry,
}

expectedView1.BaseTableId = materializedViews[0].BaseTableId
Expand Down

0 comments on commit e28b00a

Please sign in to comment.