@@ -11,7 +11,6 @@ import (
1111 "context"
1212 "fmt"
1313 "internal/abi"
14- "internal/goexperiment"
1514 "internal/profile"
1615 "internal/syscall/unix"
1716 "internal/testenv"
@@ -1576,10 +1575,6 @@ func goroutineLeakExample() {
15761575}
15771576
15781577func TestGoroutineLeakProfileConcurrency (t * testing.T ) {
1579- if ! goexperiment .GoroutineLeakProfile {
1580- // Do not run this test if the experimental flag is not enabled.
1581- t .Skip ("goroutine leak profile is not enabled" )
1582- }
15831578 const leakCount = 3
15841579
15851580 testenv .MustHaveParallelism (t )
@@ -1620,12 +1615,12 @@ func TestGoroutineLeakProfileConcurrency(t *testing.T) {
16201615 // when bulk-running tests.
16211616 //
16221617 // The two mismatching outcomes are therefore:
1623- // - More leaks than expected, which is a correctness issue with other tests.
1618+ // - More leaks than expected, which is a correctness issue with other tests.
16241619 // In this case, this test effectively checks other tests wrt
1625- // goroutine leaks running tests in bulk (e.g., by running all.bash).
1620+ // goroutine leaks during bulk executions (e.g., running all.bash).
16261621 //
1627- // - Fewer leaks than expected; this is an unfortunate symptom of scheduling
1628- // non-determinism, which may occur once in a blue moon. We make
1622+ // - Fewer leaks than expected; this is an unfortunate symptom of scheduling
1623+ // non-determinism, which may occur once in a blue moon. We make
16291624 // a best-effort attempt to allow the expected leaks to occur, by yielding
16301625 // the main thread, but it is never a guarantee.
16311626 countLeaks := func (t * testing.T , number int , s string ) {
@@ -1732,13 +1727,15 @@ func TestGoroutineLeakProfileConcurrency(t *testing.T) {
17321727 for ctx .Err () == nil {
17331728 var w strings.Builder
17341729 goroutineLeakProf .WriteTo (& w , 1 )
1735- // NOTE(vsaioc): We cannot always guarantee that the leak will actually be recorded in
1736- // the profile when making concurrent goroutine leak requests, because the GC runs
1737- // concurrently with the profiler and may reset the leaked goroutine status before
1738- // a concurrent profiler has the chance to record it.
1730+ // NOTE(vsaioc): We cannot always guarantee that the leak will
1731+ // actually be recorded in the profile when making concurrent
1732+ // goroutine leak requests, because the GC runs concurrently with
1733+ // the profiler and may reset the leaked goroutines' status before
1734+ // a concurrent profiler has the chance to record them. However,
1735+ // the goroutine leak count will persist throughout.
17391736 //
1740- // However, the goroutine leak count will persist. Still, we give some leeway by making
1741- // it an inequality, just in case other tests in the suite start leaking goroutines .
1737+ // Other tests are not expected to leak goroutines,
1738+ // so the count should be consistent .
17421739 countLeaks (t , 2 * leakCount , w .String ())
17431740 }
17441741 }()
@@ -1764,14 +1761,14 @@ func TestGoroutineLeakProfileConcurrency(t *testing.T) {
17641761 var w strings.Builder
17651762 goroutineLeakProf .WriteTo (& w , 1 )
17661763 // NOTE(vsaioc): We cannot always guarantee that the leak will
1767- // actually be recorded in the profile during concurrent
1768- // goroutine leak profile requests. The GC runs concurrently with
1769- // the profiler and may reset the leaked goroutine status before
1770- // the profiler has the chance to record the leaked stacks.
1764+ // actually be recorded in the profile when making concurrent
1765+ // goroutine leak requests, because the GC runs concurrently with
1766+ // the profiler and may reset the leaked goroutines' status before
1767+ // a concurrent profiler has the chance to record them. However,
1768+ // the goroutine leak count will persist throughout.
17711769 //
1772- // However, the leaked goroutine count is not reset.
17731770 // Other tests are not expected to leak goroutines,
1774- // so the leak count is expected to be consistent.
1771+ // so the count should be consistent.
17751772 countLeaks (t , 2 * leakCount , w .String ())
17761773 }
17771774 }()
0 commit comments