File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,7 +26,6 @@ import (
2626 "os/exec"
2727 "path/filepath"
2828 "sync"
29- "syscall"
3029 "testing"
3130 "time"
3231
@@ -40,6 +39,15 @@ import (
4039
4140var dexOnce sync.Once
4241
42+ func dexKill (t testing.TB , cmd * exec.Cmd ) {
43+ t .Helper ()
44+ // Do nothing. Without a suite setup and teardown we cannot
45+ // determine when to kill dex and Pdeathsig is only supported on
46+ // Linux.
47+ // On macOS (and Windows) the process will continue to run.
48+ // Which per se isn't a problem for development.
49+ }
50+
4351func StartDex (t testing.TB ) {
4452 t .Helper ()
4553
@@ -57,12 +65,8 @@ func StartDex(t testing.TB) {
5765 dexConfig ,
5866 )
5967
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- }
68+ // Set os-dependend killing
69+ dexKill (t , dexCmd )
6670
6771 require .NoError (t , dexCmd .Start ())
6872 })
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 dexKill (t testing.TB , cmd * exec.Cmd ) {
26+ t .Helper ()
27+ cmd .SysProcAttr = & syscall.SysProcAttr {
28+ Pdeathsig : syscall .SIGKILL ,
29+ }
30+ }
You can’t perform that action at this time.
0 commit comments