File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,6 +40,16 @@ import (
4040
4141var 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+
4353func 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 })
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments