aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/outcome/dispatcher_test.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-11-02 04:41:26 +0900
committerOphestra <cat@gensokyo.uk>2025-11-02 04:41:26 +0900
commit6931ad95c3e7d0acb45b2aafe24fb63012f061a5 (patch)
treecfb1b22fe1cdf51c15b0519224aa4d3bb4bd66cd /internal/outcome/dispatcher_test.go
parent2ba599b3997f9d4270e533ee0d0e7c235414b31a (diff)
internal/outcome/shim: EOF as exit request fallback
In some cases the signal might be delivered before the signal handler is installed, and synchronising against such a case is too expensive. Instead, use the pipe being closed as a fallback to the regular exit request. This change also moves installation of the signal handler early. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/outcome/dispatcher_test.go')
-rw-r--r--internal/outcome/dispatcher_test.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/internal/outcome/dispatcher_test.go b/internal/outcome/dispatcher_test.go
index 96822fa7..0d0568e4 100644
--- a/internal/outcome/dispatcher_test.go
+++ b/internal/outcome/dispatcher_test.go
@@ -331,9 +331,10 @@ func (k *kstub) new(f func(k syscallDispatcher, msg message.Msg)) {
k.New(func(k syscallDispatcher) { f(k, k.(*kstub)) })
}
-func (k *kstub) getpid() int { k.Helper(); return k.Expects("getpid").Ret.(int) }
-func (k *kstub) getuid() int { k.Helper(); return k.Expects("getuid").Ret.(int) }
-func (k *kstub) getgid() int { k.Helper(); return k.Expects("getgid").Ret.(int) }
+func (k *kstub) getppid() int { k.Helper(); return k.Expects("getppid").Ret.(int) }
+func (k *kstub) getpid() int { k.Helper(); return k.Expects("getpid").Ret.(int) }
+func (k *kstub) getuid() int { k.Helper(); return k.Expects("getuid").Ret.(int) }
+func (k *kstub) getgid() int { k.Helper(); return k.Expects("getgid").Ret.(int) }
func (k *kstub) lookupEnv(key string) (string, bool) {
k.Helper()
expect := k.Expects("lookupEnv")