Skip to content

Commit

Permalink
Avoid lib install command hanging indefinitely in dependencies reso…
Browse files Browse the repository at this point in the history
…lution. (arduino#2192)

* Upgrade relaxed-semver library to version 0.10.2

* Added integration test
  • Loading branch information
cmaglie authored May 31, 2023
1 parent b67b215 commit cc9eb82
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 5 deletions.
5 changes: 3 additions & 2 deletions .licenses/go/go.bug.st/relaxed-semver.dep.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
name: go.bug.st/relaxed-semver
version: v0.10.1
version: v0.10.2
type: go
summary:
summary:
homepage: https://pkg.go.dev/go.bug.st/relaxed-semver
license: bsd-3-clause
licenses:
Expand Down Expand Up @@ -42,3 +42,4 @@ licenses:
POSSIBILITY OF SUCH DAMAGE.
notices: []
...
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ require (
github.com/stretchr/testify v1.8.0
go.bug.st/cleanup v1.0.0
go.bug.st/downloader/v2 v2.1.1
go.bug.st/relaxed-semver v0.10.1
go.bug.st/relaxed-semver v0.10.2
go.bug.st/serial v1.3.2
golang.org/x/crypto v0.7.0
golang.org/x/text v0.8.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,8 @@ go.bug.st/cleanup v1.0.0 h1:XVj1HZxkBXeq3gMT7ijWUpHyIC1j8XAoNSyQ06CskgA=
go.bug.st/cleanup v1.0.0/go.mod h1:EqVmTg2IBk4znLbPD28xne3abjsJftMdqqJEjhn70bk=
go.bug.st/downloader/v2 v2.1.1 h1:nyqbUizo3E2IxCCm4YFac4FtSqqFpqWP+Aae5GCMuw4=
go.bug.st/downloader/v2 v2.1.1/go.mod h1:VZW2V1iGKV8rJL2ZEGIDzzBeKowYv34AedJz13RzVII=
go.bug.st/relaxed-semver v0.10.1 h1:g61DeaZ48IsikiPpd52wE/extF+sqX0SyllzsEIWhBM=
go.bug.st/relaxed-semver v0.10.1/go.mod h1:lPVGdtzbQ9/2fv6iXqIXWHOj6cMTUJ/l/Lu1w+sgdio=
go.bug.st/relaxed-semver v0.10.2 h1:d/ATAG3MByySZgg7rFj+Wj0fhvP4zfx9Z8Dn/NSCoFg=
go.bug.st/relaxed-semver v0.10.2/go.mod h1:lPVGdtzbQ9/2fv6iXqIXWHOj6cMTUJ/l/Lu1w+sgdio=
go.bug.st/serial v1.3.2 h1:6BFZZd/wngoL5PPYYTrFUounF54SIkykHpT98eq6zvk=
go.bug.st/serial v1.3.2/go.mod h1:jDkjqASf/qSjmaOxHSHljwUQ6eHo/ZX/bxJLQqSlvZg=
go.bug.st/testifyjson v1.1.1 h1:nHotIMK151LF3vYsU/b2RaoVaWCgrf2kvQeGNoZkGaA=
Expand Down
23 changes: 23 additions & 0 deletions internal/integrationtest/lib/lib_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1623,3 +1623,26 @@ func TestLibListDoesNotIncludeEmptyLibraries(t *testing.T) {
require.NoError(t, err)
requirejson.Len(t, stdout, 1)
}

func TestDependencyResolver(t *testing.T) {
// See: https://github.com/arduino/arduino-cli/issues/2135

env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t)
defer env.CleanUp()

_, _, err := cli.Run("lib", "update-index")
require.NoError(t, err)

done := make(chan bool)
go func() {
_, _, err := cli.Run("lib", "install", "NTPClient_Generic")
close(done)
require.Error(t, err)
}()

select {
case <-done:
case <-time.After(time.Second * 2):
require.FailNow(t, "The install command didn't complete in the allocated time")
}
}

0 comments on commit cc9eb82

Please sign in to comment.