Skip to content

Commit

Permalink
removing unrelated test
Browse files Browse the repository at this point in the history
  • Loading branch information
jmurret committed Aug 30, 2022
1 parent ed85e1e commit 7ebe704
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 55 deletions.
11 changes: 0 additions & 11 deletions net_test.go
Expand Up @@ -691,8 +691,6 @@ func TestEncryptDecryptState(t *testing.T) {
ProtocolVersion: ProtocolVersionMax,
}

sink := registerInMemorySink(t)

m, err := Create(config)
if err != nil {
t.Fatalf("err: %s", err)
Expand All @@ -716,15 +714,6 @@ func TestEncryptDecryptState(t *testing.T) {
if !reflect.DeepEqual(state, plain) {
t.Fatalf("Decrypt failed: %v", plain)
}

intv := getIntervalMetrics(t, sink)

gaugeName := "consul.usage.test.memberlist.size.remote"
actualGauge := intv.Gauges[gaugeName]

if actualGauge.Value == 0 {
t.Fatalf("memberlist.size.remote sample not taken")
}
}

func TestRawSendUdp_CRC(t *testing.T) {
Expand Down
44 changes: 0 additions & 44 deletions state_test.go
Expand Up @@ -18,8 +18,6 @@ import (
"github.com/stretchr/testify/require"
)

const healthScoreMetricGaugeName = "consul.usage.test.memberlist.health.score"

func HostMemberlist(host string, t *testing.T, f func(*Config)) *Memberlist {
t.Helper()

Expand Down Expand Up @@ -561,8 +559,6 @@ func TestMemberList_ProbeNode_Awareness_Degraded(t *testing.T) {
ip3 := []byte(addr3)
ip4 := []byte(addr4)

sink := registerInMemorySink(t)

var probeTimeMin time.Duration
m1 := HostMemberlist(addr1.String(), t, func(c *Config) {
c.ProbeTimeout = 10 * time.Millisecond
Expand Down Expand Up @@ -608,18 +604,6 @@ func TestMemberList_ProbeNode_Awareness_Degraded(t *testing.T) {
t.Fatalf("bad: %d", score)
}

intv := getIntervalMetrics(t, sink)

expectedGauge := metrics.GaugeValue{
Name: healthScoreMetricGaugeName,
Value: 1,
}
actualGauge := intv.Gauges[healthScoreMetricGaugeName]

if !reflect.DeepEqual(expectedGauge, actualGauge) {
t.Fatalf("gauges do not match")
}

// Have node m1 probe m4.
n := m1.nodeMap[addr4.String()]
startProbe := time.Now()
Expand Down Expand Up @@ -659,8 +643,6 @@ func TestMemberList_ProbeNode_Wrong_VSN(t *testing.T) {
ip3 := []byte(addr3)
ip4 := []byte(addr4)

sink := registerInMemorySink(t)

m1 := HostMemberlist(addr1.String(), t, func(c *Config) {
c.ProbeTimeout = 10 * time.Millisecond
c.ProbeInterval = 200 * time.Millisecond
Expand Down Expand Up @@ -704,18 +686,6 @@ func TestMemberList_ProbeNode_Wrong_VSN(t *testing.T) {
t.Fatalf("bad: %d", score)
}

intv := getIntervalMetrics(t, sink)

expectedGauge := metrics.GaugeValue{
Name: healthScoreMetricGaugeName,
Value: 1,
}
actualGauge := intv.Gauges[healthScoreMetricGaugeName]

if !reflect.DeepEqual(expectedGauge, actualGauge) {
t.Fatalf("gauges do not match")
}

// Have node m1 probe m4.
n, ok := m1.nodeMap[addr4.String()]
if ok || n != nil {
Expand All @@ -729,8 +699,6 @@ func TestMemberList_ProbeNode_Awareness_Improved(t *testing.T) {
ip1 := []byte(addr1)
ip2 := []byte(addr2)

sink := registerInMemorySink(t)

m1 := HostMemberlist(addr1.String(), t, func(c *Config) {
c.ProbeTimeout = 10 * time.Millisecond
c.ProbeInterval = 200 * time.Millisecond
Expand All @@ -755,18 +723,6 @@ func TestMemberList_ProbeNode_Awareness_Improved(t *testing.T) {
t.Fatalf("bad: %d", score)
}

intv := getIntervalMetrics(t, sink)

expectedGauge := metrics.GaugeValue{
Name: healthScoreMetricGaugeName,
Value: 1,
}
actualGauge := intv.Gauges[healthScoreMetricGaugeName]

if !reflect.DeepEqual(expectedGauge, actualGauge) {
t.Fatalf("gauges do not match")
}

// Have node m1 probe m2.
n := m1.nodeMap[addr2.String()]
m1.probeNode(n)
Expand Down

0 comments on commit 7ebe704

Please sign in to comment.