@@ -37,18 +37,15 @@ var _ = ginkgo.Describe("NPD should export Prometheus metrics.", func() {
37
37
var instance gce.Instance
38
38
39
39
ginkgo .BeforeEach (func () {
40
- var err error
41
- // TODO(xueweiz): Creating instance for each test case is slow. We should either reuse the instance
42
- // between tests, or have a way to run these tests in parallel.
43
- if * imageFamily != "" && * image == "" {
44
- gceImage , err := computeService .Images .GetFromFamily (* imageProject , * imageFamily ).Do ()
45
- if err != nil {
46
- ginkgo .Fail (fmt .Sprintf ("Unable to get image from family %s at project %s: %v" ,
47
- * imageFamily , * imageProject , err ))
48
- }
49
- * image = gceImage .Name
50
- fmt .Printf ("Using image %s from image family %s at project %s\n " , * image , * imageFamily , * imageProject )
40
+ imageProject := "ubuntu-os-gke-cloud"
41
+ imageFamily := "pipeline-1-24"
42
+ gceImage , err := computeService .Images .GetFromFamily (imageProject , imageFamily ).Do ()
43
+ if err != nil {
44
+ ginkgo .Fail (fmt .Sprintf ("Unable to get image from family %s at project %s: %v" ,
45
+ imageFamily , imageProject , err ))
51
46
}
47
+ * image = gceImage .Name
48
+ fmt .Printf ("Using image %s from image family %s at project %s\n " , * image , imageFamily , imageProject )
52
49
instance , err = gce .CreateInstance (
53
50
gce.Instance {
54
51
Name : "npd-metrics-" + * image + "-" + uuid .NewUUID ().String ()[:8 ],
@@ -59,7 +56,7 @@ var _ = ginkgo.Describe("NPD should export Prometheus metrics.", func() {
59
56
ComputeService : computeService ,
60
57
},
61
58
* image ,
62
- * imageProject )
59
+ imageProject )
63
60
Expect (err ).NotTo (HaveOccurred (), fmt .Sprintf ("Unable to create test instance: %v" , err ))
64
61
65
62
err = npd .SetupNPD (instance , * npdBuildTar )
@@ -120,34 +117,6 @@ var _ = ginkgo.Describe("NPD should export Prometheus metrics.", func() {
120
117
})
121
118
})
122
119
123
- ginkgo .Context ("When ext4 filesystem error happens" , func () {
124
-
125
- ginkgo .BeforeEach (func () {
126
- err := npd .WaitForNPD (instance , []string {"problem_gauge" }, 120 )
127
- Expect (err ).NotTo (HaveOccurred (), fmt .Sprintf ("Expect NPD to become ready in 120s, but hit error: %v" , err ))
128
- // This will trigger a ext4 error on the boot disk, causing the boot disk mounted as read-only and systemd-journald crashing.
129
- instance .RunCommandOrFail ("sudo /home/kubernetes/bin/problem-maker --problem Ext4FilesystemError" )
130
- })
131
-
132
- ginkgo .It ("NPD should update problem_counter{reason:Ext4Error} and problem_gauge{type:ReadonlyFilesystem}" , func () {
133
- ginkgo .Skip ("Writing to /sys/fs/ext4/sda1/trigger_fs_error breaks SSH: https://github.com/kubernetes/node-problem-detector/issues/970" )
134
- time .Sleep (5 * time .Second )
135
- assertMetricValueAtLeast (instance ,
136
- "problem_counter" , map [string ]string {"reason" : "Ext4Error" },
137
- 1.0 )
138
- assertMetricValueInBound (instance ,
139
- "problem_gauge" , map [string ]string {"reason" : "FilesystemIsReadOnly" , "type" : "ReadonlyFilesystem" },
140
- 1.0 , 1.0 )
141
- })
142
-
143
- ginkgo .It ("NPD should remain healthy" , func () {
144
- ginkgo .Skip ("Writing to /sys/fs/ext4/sda1/trigger_fs_error breaks SSH: https://github.com/kubernetes/node-problem-detector/issues/970" )
145
- npdStates := instance .RunCommandOrFail ("sudo systemctl show node-problem-detector -p ActiveState -p SubState" )
146
- Expect (npdStates .Stdout ).To (ContainSubstring ("ActiveState=active" ), "NPD is no longer active: %v" , npdStates )
147
- Expect (npdStates .Stdout ).To (ContainSubstring ("SubState=running" ), "NPD is no longer running: %v" , npdStates )
148
- })
149
- })
150
-
151
120
ginkgo .Context ("When OOM kills and docker hung happen" , func () {
152
121
153
122
ginkgo .BeforeEach (func () {
0 commit comments