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
7 changes: 6 additions & 1 deletion hack/provider_update_ci/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@ import (
"os/exec"
)

// providerTestCommand omits -race: the Go runtime crashes intermittently on
// windows/amd64 under -race during goroutine stack shrink/copy (observed in
// net/http server teardown; matches golang/go#77975, #77955, #78041, still
// reproducing on go1.26.9). pkg/workspace and pkg/provider keep -race
// coverage on ubuntu-latest and macos-latest via the Unit Tests job.
func providerTestCommand(selection string) *exec.Cmd {
args := []string{"test", "-race", "-json", "-count=1", "-timeout", windowsTestTimeout}
args := []string{"test", "-json", "-count=1", "-timeout", windowsTestTimeout}
args = append(args, providerUpdatePackages...)
args = append(args, selection, providerUpdateRunPattern)
return exec.Command("go", args...)
Expand Down
6 changes: 3 additions & 3 deletions hack/provider_update_ci/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ func isFakeGoInvocation(path string) bool {
}

func isExpectedGoCommand(args []string) bool {
if len(args) != 10 || (args[8] != "-run" && args[8] != "-list") {
if len(args) != 9 || (args[7] != "-run" && args[7] != "-list") {
return false
}
expected := []string{
"test", "-race", "-json", "-count=1", "-timeout", "10m",
providerUpdatePackages[0], providerUpdatePackages[1], args[8], providerUpdateRunPattern,
"test", "-json", "-count=1", "-timeout", "10m",
providerUpdatePackages[0], providerUpdatePackages[1], args[7], providerUpdateRunPattern,
}
return equalStrings(args, expected)
}
Expand Down
4 changes: 3 additions & 1 deletion pkg/workspace/provider_update_extended_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ const (
updateCurrentLink = "current"
updateMiddleLink = "middle"
updateEntryLink = "entry"
// updateTestHangGuard is a hang-safety bound, not a target duration.
updateTestHangGuard = 60 * time.Second
)

type preservationFixture struct {
Expand Down Expand Up @@ -174,7 +176,7 @@ func (f *preservationFixture) update(binaries map[string][]*provider.ProviderBin
}
raw, err := json.Marshal(replacement)
require.NoError(f.t, err)
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
ctx, cancel := context.WithTimeout(context.Background(), updateTestHangGuard)
defer cancel()
_, err = updateProvider(
ctx,
Expand Down
10 changes: 5 additions & 5 deletions pkg/workspace/provider_update_prepared_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ func TestProviderUpdateCachedReplacement(t *testing.T) {
binaries := map[string][]*provider.ProviderBinary{
updateRuntimeKey: {updateTestBinary(server.URL+"/runtime", content)},
}
ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
ctx, cancel := context.WithTimeout(context.Background(), updateTestHangGuard)
defer cancel()
_, err := provider.DownloadBinaries(ctx, binaries, t.TempDir())
require.NoError(t, err)
Expand Down Expand Up @@ -812,7 +812,7 @@ func TestProviderUpdateCachedArchiveReplacement(t *testing.T) {
binary := updateTestBinary(server.URL+"/provider.tgz", content)
binary.ArchivePath = updateRuntimeName
binaries := map[string][]*provider.ProviderBinary{updateRuntimeKey: {binary}}
ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
ctx, cancel := context.WithTimeout(context.Background(), updateTestHangGuard)
defer cancel()
_, err := provider.DownloadBinaries(ctx, binaries, t.TempDir())
require.NoError(t, err)
Expand Down Expand Up @@ -1186,7 +1186,7 @@ func warmProviderUpdateCache(
server *httptest.Server,
) {
t.Helper()
ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
ctx, cancel := context.WithTimeout(context.Background(), updateTestHangGuard)
defer cancel()
_, err := provider.DownloadBinaries(ctx, binaries, t.TempDir())
require.NoError(t, err)
Expand Down Expand Up @@ -1295,7 +1295,7 @@ func TestProviderUpdateNestedAndLeafAliasOfflineCache(t *testing.T) {
binary := updateTestBinary(server.URL+"/nested-alias.tar", content)
binary.ArchivePath = a.selected
binaries := map[string][]*provider.ProviderBinary{updateRuntimeKey: {binary}}
ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
ctx, cancel := context.WithTimeout(context.Background(), updateTestHangGuard)
defer cancel()
_, err := provider.DownloadBinaries(ctx, binaries, t.TempDir())
require.NoError(t, err)
Expand Down Expand Up @@ -1384,7 +1384,7 @@ func TestProviderUpdateAncestorRootAliasOfflineCache(t *testing.T) {
binary := updateTestBinary(server.URL+"/ancestor-root.tar", content)
binary.ArchivePath = selected
binaries := map[string][]*provider.ProviderBinary{updateRuntimeKey: {binary}}
ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
ctx, cancel := context.WithTimeout(context.Background(), updateTestHangGuard)
defer cancel()
_, err := provider.DownloadBinaries(ctx, binaries, t.TempDir())
require.NoError(t, err)
Expand Down
3 changes: 1 addition & 2 deletions pkg/workspace/provider_update_preservation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"runtime"
"sync/atomic"
"testing"
"time"

"github.com/devsy-org/devsy/pkg/config"
"github.com/devsy-org/devsy/pkg/provider"
Expand Down Expand Up @@ -47,7 +46,7 @@ func TestProviderUpdateFailedDownloadPreservesExisting(t *testing.T) {
}
raw, err := json.Marshal(replacement)
require.NoError(t, err)
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
ctx, cancel := context.WithTimeout(context.Background(), updateTestHangGuard)
defer cancel()
_, err = updateProvider(ctx, ProviderParams{
DevsyConfig: f.config,
Expand Down
Loading