Skip to content

Commit

Permalink
Merge pull request #2222 from josephschorr/serve-tests
Browse files Browse the repository at this point in the history
Remove parallel test to reduce flakiness
  • Loading branch information
josephschorr authored Jan 31, 2025
2 parents 6db2a39 + 9dd61da commit 88063a2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/spicedb/migrate_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func TestMigrate(t *testing.T) {

t.Run(engineKey, func(t *testing.T) {
engineKey := engineKey
t.Parallel()

r := testdatastore.RunDatastoreEngineWithBridge(t, engineKey, bridgeNetworkName)
db := r.NewDatabase(t)

Expand Down
19 changes: 18 additions & 1 deletion cmd/spicedb/servetesting_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package main

import (
"bytes"
"context"
"fmt"
"io"
Expand All @@ -18,6 +19,7 @@ import (
"github.com/authzed/grpcutil"
"github.com/google/uuid"
"github.com/ory/dockertest/v3"
"github.com/ory/dockertest/v3/docker"
"github.com/stretchr/testify/require"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
Expand Down Expand Up @@ -240,7 +242,22 @@ func newTester(t *testing.T, containerOpts *dockertest.RunOptions, token string,
return err
})
if err != nil {
fmt.Printf("got error on startup: %v\n", err)
stream := new(bytes.Buffer)

waitCtx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
defer cancel()

lerr := pool.Client.Logs(docker.LogsOptions{
Context: waitCtx,
OutputStream: stream,
ErrorStream: stream,
Stdout: true,
Stderr: true,
Container: resource.Container.ID,
})
require.NoError(t, lerr)

fmt.Printf("got error on startup: %v\ncontainer logs: %s\n", err, stream.String())
cleanup()
continue
}
Expand Down

0 comments on commit 88063a2

Please sign in to comment.