Skip to content

Commit

Permalink
Fix parallel test issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
q-uint committed May 4, 2024
1 parent 96ca38a commit e2e2395
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
9 changes: 3 additions & 6 deletions pocketic/endpoints_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"
)

func TestEndpoints(t *testing.T) {
func Endpoints(t *testing.T) *pocketic.PocketIC {
pic, err := pocketic.New(
pocketic.WithLogger(new(testLogger)),
pocketic.WithNNSSubnet(),
Expand All @@ -14,11 +14,6 @@ func TestEndpoints(t *testing.T) {
if err != nil {
t.Fatal(err)
}
defer func() {
if err := pic.Close(); err != nil {
t.Fatal(err)
}
}()

t.Run("status", func(t *testing.T) {
if err := pic.Status(); err != nil {
Expand All @@ -38,4 +33,6 @@ func TestEndpoints(t *testing.T) {
t.Fatalf("unexpected blob size: %d", len(bytes))
}
})

return pic
}
3 changes: 3 additions & 0 deletions pocketic/pocketic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ func TestPocketIC(t *testing.T) {
t.Run("HttpGateway", func(t *testing.T) {
instances = append(instances, HttpGateway(t))
})
t.Run("Endpoints", func(t *testing.T) {
instances = append(instances, Endpoints(t))
})
for _, i := range instances {
if err := i.Close(); err != nil {
t.Fatal(err)
Expand Down

0 comments on commit e2e2395

Please sign in to comment.