Skip to content

Commit

Permalink
Merge branch 'develop' into changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
dshulyak committed Aug 23, 2023
2 parents a11bf88 + 264e589 commit bf996d3
Show file tree
Hide file tree
Showing 15 changed files with 151 additions and 1,375 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ require (
github.com/spacemeshos/go-scale v1.1.10
github.com/spacemeshos/merkle-tree v0.2.2
github.com/spacemeshos/poet v0.8.9
github.com/spacemeshos/post v0.9.1
github.com/spacemeshos/post v0.9.2
github.com/spf13/afero v1.9.5
github.com/spf13/cobra v1.7.0
github.com/spf13/pflag v1.0.5
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -618,8 +618,8 @@ github.com/spacemeshos/merkle-tree v0.2.2 h1:+zF+17CwVebq9UzShunUBXv16rEVKIJHh2C
github.com/spacemeshos/merkle-tree v0.2.2/go.mod h1:0Q/z4S5Kt9qz/c3qWa7hKA1yT7n7odyysbPIUTRu/xo=
github.com/spacemeshos/poet v0.8.9 h1:JX8BjeyIvRguSVk4d45Oa49AdTG3Z+93vD7gc5MRDNc=
github.com/spacemeshos/poet v0.8.9/go.mod h1:hi7BDUyYW9VGRFBnA40wrvnU+O4ZHYps1wuNwziJpQ0=
github.com/spacemeshos/post v0.9.1 h1:4mEANEhHp5yxPfj+mpO/gS78jjDckVUJcSg5slTRnLM=
github.com/spacemeshos/post v0.9.1/go.mod h1:rbHDofaGEiFuxSefJ0MPu2dMzyCvXmFWSMTXIn77lEc=
github.com/spacemeshos/post v0.9.2 h1:xIxFAhO6qa9ScRzt3Yiog3Fie+ZrX0jPKQFMcKhpn3A=
github.com/spacemeshos/post v0.9.2/go.mod h1:sWxWEfxH4wc4D2KCY0kBMu4ezz/v52Km/N023SaCcNE=
github.com/spacemeshos/sha256-simd v0.1.0 h1:G7Mfu5RYdQiuE+wu4ZyJ7I0TI74uqLhFnKblEnSpjYI=
github.com/spacemeshos/sha256-simd v0.1.0/go.mod h1:O8CClVIilId7RtuCMV2+YzMj6qjVn75JsxOxaE8vcfM=
github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=
Expand Down
29 changes: 17 additions & 12 deletions node/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,6 @@ func NewTestNetwork(t *testing.T, conf config.Config, l log.Log, size int) []*Te
g, grpContext := errgroup.WithContext(ctx)
var apps []*TestApp

t.Cleanup(func() {
cancel()
// Wait for nodes to shutdown
g.Wait()

ctx, cancel := context.WithTimeout(context.Background(), time.Second*10)
defer cancel()
for _, a := range apps {
a.Cleanup(ctx)
}
})

for i := 0; i < size; i++ {
// Copy config, services don't modify their config, so we just need to
// be careful here when we modify any pointer values in the config.
Expand Down Expand Up @@ -83,6 +71,23 @@ func NewTestNetwork(t *testing.T, conf config.Config, l log.Log, size int) []*Te
apps = append(apps, &TestApp{app, conn})
}

// Note that we must call cleanup after all calls to t.TempDir since calls
// to cleanup are executed in LIFO fashion (similar to defer) and t.TempDir
// internally calls Cleanup to delete the dir. By calling Cleanup here
// we ensure that the apps have been shut-down before attempting to delete
// the temp dirs.
t.Cleanup(func() {
cancel()
// Wait for nodes to shutdown
g.Wait()

ctx, cancel := context.WithTimeout(context.Background(), time.Second*10)
defer cancel()
for _, a := range apps {
a.Cleanup(ctx)
}
})

// Connect all nodes to each other
for i := 0; i < size; i++ {
for j := i + 1; j < size; j++ {
Expand Down

0 comments on commit bf996d3

Please sign in to comment.