Debian Patches

Status for golang-github-google-goexpect/0.0~git20210430.ab937bf-2

Patch Description Author Forwarded Bugs Origin Last update
extend-timeout-SendSignal_Batch-test.patch Increase timeout for SendSignal_Batch test
Increase the timeout for the ExampleGExpect_SendSignal_Batch test from
20s to 30s. This test was failing in the Salsa CI environment due to a
timeout, suggesting the test process takes longer to respond there
compared to local environments.
Otto Kekäläinen <otto@debian.org> no 2025-05-19
fix-test-panic-seen-on-ppc64el.patch Fix TestTee panic on Spawn error seen on ppc64el
The `TestTee` function was susceptible to a panic due to a nil pointer
dereference if the `Spawn` function failed as observed on the `ppc64el`
architecture during autopkgtests:

github.com/google/goexpect
dh_auto_test -O--builddirectory=debian/.build/upstream -O--buildsystem=golang
^Icd debian/.build/upstream && go test -vet=off -v -p 16 github.com/google/goexpect
=== RUN TestBatcher
2025/08/22 06:57:28 at login prompt
2025/08/22 06:57:28 at password prompt
2025/08/22 06:57:28 Done sent
E0822 06:57:28.425817 7480 expect_test.go:138] Accept failed: accept tcp [::]:42685: use of closed network connection
--- PASS: TestBatcher (0.08s)
=== RUN TestTee
--- FAIL: TestTee (0.00s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
^Ipanic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x2e6c64]

goroutine 60 [running]:
testing.tRunner.func1.2({0x392ec0, 0x6cd9e0})
^I/usr/lib/go-1.24/src/testing/testing.go:1734 +0x1d8
testing.tRunner.func1()
^I/usr/lib/go-1.24/src/testing/testing.go:1737 +0x33c
panic({0x392ec0?, 0x6cd9e0?})
^I/usr/lib/go-1.24/src/runtime/panic.go:792 +0x154
github.com/google/goexpect.(*GExpect).check(0x37aa40?)
^I/tmp/autopkgtest-lxc.onolzjvd/downtmp/autopkgtest_tmp/debian/.build/upstream/src/github.com/google/goexpect/expect.go:690 +0x34
github.com/google/goexpect.(*GExpect).Send(0x0, {0x4004e6, 0x7})
^I/tmp/autopkgtest-lxc.onolzjvd/downtmp/autopkgtest_tmp/debian/.build/upstream/src/github.com/google/goexpect/expect.go:1223 +0x4c
github.com/google/goexpect.TestTee(0xc00034ac40)
^I/tmp/autopkgtest-lxc.onolzjvd/downtmp/autopkgtest_tmp/debian/.build/upstream/src/github.com/google/goexpect/expect_test.go:710 +0x178
testing.tRunner(0xc00034ac40, 0x41a0e0)
^I/usr/lib/go-1.24/src/testing/testing.go:1792 +0x110
created by testing.(*T).Run in goroutine 1
^I/usr/lib/go-1.24/src/testing/testing.go:1851 +0x3ec
FAIL^Igithub.com/google/goexpect^I0.093s
FAIL
dh_auto_test: error: cd debian/.build/upstream && go test -vet=off -v -p 16 github.com/google/goexpect returned exit code 1
make: *** [debian/rules:9: build] Error 25


The `Spawn` function can return an error and a nil `GExpect` object if it fails
to initialize the process. The test, however, did not check for this error and
proceeded to call methods on the potentially nil `GExpect` object, leading to a
panic.

If `Spawn` returns an error, the test will now fail gracefully with a `t.Fatalf`
message, preventing the nil pointer dereference and subsequent panic. This makes
the test more robust against transient failures or environment-specific issues
during process spawning.
=?utf-8?b?T3R0byBLZWvDpGzDpGluZW4=?= <otto@debian.org> no 2025-08-23
skip-pty-tests-on-unsupported-platforms.patch Skip PTY-dependent tests on unsupported platforms (mainly ppc64el)
The `goexpect` test suite includes tests that rely on pseudo-terminal
(PTY) support. On some architectures and builders, such as `ppc64el` on
both Debian buildd and Ubuntu Launchpad, the test environment may didn't
seem to provide full PTY functionality, leading to `inappropriate ioctl
for device` errors when `Spawn` or `SpawnWithArgs` are called.

Fix multiple tests to detect the `inappropriate ioctl for device` error
and skip the test gracefully, allowing the package to build
successfully.

The `TestSpawnWithArgs` test also adds a `defer e.Close()` to ensure the
expecter is properly closed, regardless of test outcome.
=?utf-8?b?T3R0byBLZWvDpGzDpGluZW4=?= <otto@debian.org> no 2025-08-25
improve-reliability-of-TestSpawnWithArgs-on-s390x.patch Fix TestSpawnWithArgs race condition on fast systems (mainly s390x)
The `TestSpawnWithArgs` test was failing on the Ubuntu Launchpad `s390x`
builders with the error "Expect(a b) failed: expect: Process not
running". This indicates a race condition where the `echo` command
executed and terminated too quickly for the `Expect` function to read
its output before the process was gone.

To address this, wait with `read`, that command pauses the shell script
indefinitely until input is received, which is a more robust and
portable way to keep the process alive for the duration of the test.
After the necessary `Expect` calls, an explicit `e.Send("\n")` is added
to unblock the `read` command and allow the spawned process to exit
cleanly.

Additionally, the `t.Fatalf` message has been updated to include the
`args` slice for better debugging context if `SpawnWithArgs` fails.
=?utf-8?b?T3R0byBLZWvDpGzDpGluZW4=?= <otto@debian.org> no 2025-08-25

All known versions for source package 'golang-github-google-goexpect'

Links