Makes sure we don't create a full table watch for tombstones.
This commit is contained in:
parent
4be951571e
commit
391c04de90
|
@ -88,7 +88,7 @@ func NewStateStore(logOutput io.Writer) (*StateStore, error) {
|
||||||
// Build up the all-table watches.
|
// Build up the all-table watches.
|
||||||
tableWatches := make(map[string]*FullTableWatch)
|
tableWatches := make(map[string]*FullTableWatch)
|
||||||
for table, _ := range schema.Tables {
|
for table, _ := range schema.Tables {
|
||||||
if table == "kvs" {
|
if table == "kvs" || table == "tombstones" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -240,12 +240,24 @@ func TestStateStore_GetTableWatch(t *testing.T) {
|
||||||
// This test does two things - it makes sure there's no full table
|
// This test does two things - it makes sure there's no full table
|
||||||
// watch for KVS, and it makes sure that asking for a watch that
|
// watch for KVS, and it makes sure that asking for a watch that
|
||||||
// doesn't exist causes a panic.
|
// doesn't exist causes a panic.
|
||||||
defer func() {
|
func() {
|
||||||
if r := recover(); r == nil {
|
defer func() {
|
||||||
t.Fatalf("didn't get expected panic")
|
if r := recover(); r == nil {
|
||||||
}
|
t.Fatalf("didn't get expected panic")
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
s.GetTableWatch("kvs")
|
||||||
|
}()
|
||||||
|
|
||||||
|
// Similar for tombstones; those don't support watches at all.
|
||||||
|
func() {
|
||||||
|
defer func() {
|
||||||
|
if r := recover(); r == nil {
|
||||||
|
t.Fatalf("didn't get expected panic")
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
s.GetTableWatch("tombstones")
|
||||||
}()
|
}()
|
||||||
s.GetTableWatch("kvs")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestStateStore_EnsureRegistration(t *testing.T) {
|
func TestStateStore_EnsureRegistration(t *testing.T) {
|
||||||
|
|
Loading…
Reference in New Issue