ROOTPLOIT
Server: LiteSpeed
System: Linux in-mum-web1878.main-hosting.eu 5.14.0-570.21.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jun 11 07:22:35 EDT 2025 x86_64
User: u435929562 (435929562)
PHP: 7.4.33
Disabled: system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: //opt/golang/1.22.0/src/cmd/go/testdata/script/test_cleanup_failnow.txt
# For issue 41355
[short] skip

# This test could fail if the testing package does not wait until
# a panicking test does the panic. Turn off multithreading and GC
# to increase the probability of such a failure.
env GOMAXPROCS=1
env GOGC=off

# If the test exits with 'no tests to run', it means the testing package
# implementation is incorrect and does not wait until a test panic.
# If the test exits with '(?s)panic: die.*panic: die', it means
# the testing package did an extra panic for a panicking test.

! go test -v cleanup_failnow/panic_nocleanup_test.go
! stdout 'no tests to run'
stdout '(?s)panic: die \[recovered\].*panic: die'
! stdout '(?s)panic: die \[recovered\].*panic: die.*panic: die'

! go test -v cleanup_failnow/panic_withcleanup_test.go
! stdout 'no tests to run'
stdout '(?s)panic: die \[recovered\].*panic: die'
! stdout '(?s)panic: die \[recovered\].*panic: die.*panic: die'

-- cleanup_failnow/panic_nocleanup_test.go --
package panic_nocleanup_test
import "testing"
func TestX(t *testing.T) {
	t.Run("x", func(t *testing.T) {
		panic("die")
	})
}

-- cleanup_failnow/panic_withcleanup_test.go --
package panic_withcleanup_test
import "testing"
func TestCleanupWithFailNow(t *testing.T) {
	t.Cleanup(func() {
		t.FailNow()
	})
	t.Run("x", func(t *testing.T) {
		t.Run("y", func(t *testing.T) {
			panic("die")
		})
	})
}