Skip to content

Commit 079729a

Browse files
committed
Just ignore dex on non-linux
Signed-off-by: Nelo-T. Wallus <red.brush9525@fastmail.com> Signed-off-by: Nelo-T. Wallus <n.wallus@sap.com>
1 parent 443163d commit 079729a

2 files changed

Lines changed: 44 additions & 6 deletions

File tree

test/e2e/framework/dex.go

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,16 @@ import (
4040

4141
var dexOnce sync.Once
4242

43+
var dexKill = func(t testing.TB, cmd *exec.Cmd) {
44+
t.Helper()
45+
// Do nothing. Without a suite setup and teardown we cannot
46+
// determine when to kill dex and Pdeathsig is only supported on
47+
// Linux.
48+
// On macOS (and Windows) the process will continue to run.
49+
// Which per se isn't a problem for development.
50+
cmd.SysProcAttr = &syscall.SysProcAttr{}
51+
}
52+
4353
func StartDex(t testing.TB) {
4454
t.Helper()
4555

@@ -57,12 +67,8 @@ func StartDex(t testing.TB) {
5767
dexConfig,
5868
)
5969

60-
// Ensures that dex is killed when the process ends.
61-
dexCmd.SysProcAttr = &syscall.SysProcAttr{
62-
Pdeathsig: syscall.SIGKILL,
63-
Setpgid: true,
64-
Pgid: 0,
65-
}
70+
// Set os-dependend killing
71+
dexKill(t, dexCmd)
6672

6773
require.NoError(t, dexCmd.Start())
6874
})

test/e2e/framework/dex_linux.go

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
Copyright 2025 The Kube Bind Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package framework
18+
19+
import (
20+
"os/exec"
21+
"syscall"
22+
"testing"
23+
)
24+
25+
func init() {
26+
dexKill = func(t testing.TB, cmd *exec.Cmd) {
27+
t.Helper()
28+
cmd.SysProcAttr = &syscall.SysProcAttr{
29+
Pdeathsig: syscall.SIGKILL,
30+
}
31+
}
32+
}

0 commit comments

Comments
 (0)