Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions internal/cas/clone_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func TestCASClone_E2E_DepthQueryParamWithTag(t *testing.T) {
c, err := cas.New(venvtest.NewWithOSFS(), cas.WithStorePath(filepath.Join(tempDir, "store")))
require.NoError(t, err)

v := venv.OSVenv()
v := venvtest.NewOSWithEmptyEnv()
l := logger.CreateLogger()

// Ambient depth left at the CAS default of 1, which is what makes this
Expand Down Expand Up @@ -272,7 +272,7 @@ func TestCASClone_E2E_AmbientDepthBeatsURLDepth(t *testing.T) {
c, err := cas.New(venvtest.NewWithOSFS(), cas.WithStorePath(storePath), cas.WithCloneDepth(-1))
require.NoError(t, err)

v := venv.OSVenv()
v := venvtest.NewOSWithEmptyEnv()
l := logger.CreateLogger()

g := getter.NewCASGetter(l, c, v, &cas.CloneOptions{})
Expand Down
2 changes: 1 addition & 1 deletion internal/cas/stacks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ func TestProcessStackComponent_AcceptsDepthQueryParam(t *testing.T) {
c, err := cas.New(venvtest.NewWithOSFS(), cas.WithStorePath(storePath), cas.WithCloneDepth(-1))
require.NoError(t, err)

v := venv.OSVenv()
v := venvtest.NewOSWithEmptyEnv()

source := "git::" + repoURL + "//stacks/my-stack?depth=1&ref=main"

Expand Down
2 changes: 1 addition & 1 deletion internal/os/exec/cmd_unix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func TestNewSignalsForwarderMultipleUnix(t *testing.T) {
runChannel <- cmd.Run(l)
}()

requireTrapReady(t, readyPath)
requireInterruptCount(t, readyPath, 0)

// Bash defers its trap until the running `sleep` returns, so two signals delivered within
// one sleep window collapse into a single handler run. Waiting for the child to
Expand Down
15 changes: 11 additions & 4 deletions internal/os/exec/testdata/test_sigint_multiple.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,28 @@ set -e
INT_REQUIRED=$1
READY_FILE=$2
INT_COUNTER=0
PUBLISHED=-1

trap int_handler INT

# shellcheck disable=SC2329 # invoked indirectly via trap
function int_handler() {
INT_COUNTER=$((INT_COUNTER + 1))
printf '%s\n' "$INT_COUNTER" >"$READY_FILE"
}

# A readable count tells the test the INT trap is installed and, from then on, how many
# signals have actually been handled.
printf '%s\n' "$INT_COUNTER" >"$READY_FILE"
# Publishing outside the trap means a count the test can read implies the handler returned.
function publish_count() {
if [[ $INT_COUNTER -ne $PUBLISHED ]]; then
printf '%s\n' "$INT_COUNTER" >"$READY_FILE"
PUBLISHED=$INT_COUNTER
fi
}

publish_count

while [[ $INT_COUNTER -lt $INT_REQUIRED ]]; do
sleep 0.1
publish_count
done

exit "$INT_COUNTER"
Loading