Skip to content

Commit e512d3d

Browse files
committed
update
1 parent 70afda7 commit e512d3d

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

tools/flakeguard/runner/example_test_package/example_tests_test.go

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -213,15 +213,13 @@ func TestTimeout(t *testing.T) {
213213
t.Logf("This test should have timed out")
214214
}
215215

216-
// 1) No subtests at all
217216
func TestParentNoSubtests(t *testing.T) {
218217
t.Parallel()
219218

220219
t.Log("No subtests, just a single test that passes.")
221220
// (Optional) you could also do t.Fail() or t.Fatal() to produce a fail
222221
}
223222

224-
// 2) All subtests pass, no parent fail
225223
func TestParentAllPassSubtests(t *testing.T) {
226224
t.Parallel()
227225
t.Log("Parent does not fail, subtests all pass")
@@ -236,7 +234,6 @@ func TestParentAllPassSubtests(t *testing.T) {
236234
})
237235
}
238236

239-
// 3) All subtests fail, no parent fail
240237
func TestParentAllFailSubtests(t *testing.T) {
241238
t.Parallel()
242239
t.Log("Parent does not fail, subtests all fail => typically the parent is marked fail by Go")
@@ -251,22 +248,6 @@ func TestParentAllFailSubtests(t *testing.T) {
251248
})
252249
}
253250

254-
// 4) Some subtests pass, some fail, parent does NOT do its own fail
255-
func TestParentSomeFailSubtests(t *testing.T) {
256-
t.Parallel()
257-
t.Log("Parent does not fail, subtests partially pass/fail => parent is typically fail unless 'zeroOutParentFailsIfSubtestOnlyFails' modifies it")
258-
259-
t.Run("Pass", func(t *testing.T) {
260-
t.Parallel()
261-
t.Log("This subtest passes")
262-
})
263-
t.Run("Fail", func(t *testing.T) {
264-
t.Parallel()
265-
t.Fatal("This subtest fails")
266-
})
267-
}
268-
269-
// 5) Parent fails *after* subtests
270251
func TestParentOwnFailAfterSubtests(t *testing.T) {
271252
t.Parallel()
272253
t.Log("Parent fails after subtests pass => genuine parent-level failure")
@@ -284,7 +265,6 @@ func TestParentOwnFailAfterSubtests(t *testing.T) {
284265
t.Fatal("Parent test fails after subtests pass")
285266
}
286267

287-
// 6) Parent fails *before* subtests
288268
func TestParentOwnFailBeforeSubtests(t *testing.T) {
289269
t.Parallel()
290270
t.Log("Parent fails before subtests => subtests might not even run in real usage, or still get reported, depending on concurrency")
@@ -297,7 +277,6 @@ func TestParentOwnFailBeforeSubtests(t *testing.T) {
297277
})
298278
}
299279

300-
// 7) Nested subtests: parent -> child -> grandchild
301280
func TestNestedSubtests(t *testing.T) {
302281
t.Parallel()
303282
t.Log("Deep nesting example")

0 commit comments

Comments
 (0)