Skip to content

Commit c9598b8

Browse files
vvfedorenkofacebook-github-bot
authored andcommitted
exclude flaky Ping test from race check
Summary: Ping tests are flaky on GitHub, let's move them to a different test file and exclude them from racy tests Differential Revision: D67942189
1 parent 3d9cd3d commit c9598b8

File tree

2 files changed

+47
-23
lines changed

2 files changed

+47
-23
lines changed

calnex/verify/checks/checks_test.go

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -116,29 +116,6 @@ func TestHTTPError(t *testing.T) {
116116
require.Equal(t, want, got)
117117
}
118118

119-
func TestPing(t *testing.T) {
120-
r := PingRemediation{}
121-
c := Ping{Remediation: r}
122-
require.Equal(t, "Ping", c.Name())
123-
124-
err := c.Run("::1", false)
125-
require.NoError(t, err)
126-
}
127-
128-
func TestPingError(t *testing.T) {
129-
r := PingRemediation{}
130-
c := Ping{Remediation: r}
131-
require.Equal(t, "Ping", c.Name())
132-
133-
err := c.Run("1.2.3.4", false)
134-
require.Error(t, err)
135-
136-
want, _ := r.Remediate()
137-
got, err := c.Remediate()
138-
require.NoError(t, err)
139-
require.Equal(t, want, got)
140-
}
141-
142119
func TestPSU(t *testing.T) {
143120
r := PSURemediation{}
144121
c := PSU{Remediation: r}

calnex/verify/checks/ping_test.go

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// +build !race
2+
/*
3+
Copyright (c) Facebook, Inc. and its affiliates.
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
*/
17+
18+
package checks
19+
20+
import (
21+
"testing"
22+
23+
"github.com/stretchr/testify/require"
24+
)
25+
26+
func TestPing(t *testing.T) {
27+
r := PingRemediation{}
28+
c := Ping{Remediation: r}
29+
require.Equal(t, "Ping", c.Name())
30+
31+
err := c.Run("::1", false)
32+
require.NoError(t, err)
33+
}
34+
35+
func TestPingError(t *testing.T) {
36+
r := PingRemediation{}
37+
c := Ping{Remediation: r}
38+
require.Equal(t, "Ping", c.Name())
39+
40+
err := c.Run("1.2.3.4", false)
41+
require.Error(t, err)
42+
43+
want, _ := r.Remediate()
44+
got, err := c.Remediate()
45+
require.NoError(t, err)
46+
require.Equal(t, want, got)
47+
}

0 commit comments

Comments
 (0)