Skip to content

Commit

Permalink
acceptanceccl: unskip CDC acceptance test
Browse files Browse the repository at this point in the history
I stressed this for half an hour with no repros, so I suspect the
original failure is something with teamcity (it was happening relatively
frequently on CI). This unskips the test and adds some additional
debugging in case it happens again.

Release note: None
  • Loading branch information
danhhz committed Aug 20, 2018
1 parent b0ede4d commit 66ba1f0
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
5 changes: 5 additions & 0 deletions pkg/acceptance/cluster/dockercluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,11 @@ func CreateDocker(
}
}

// Client returns the underlying docker client.
func (l *DockerCluster) Client() client.APIClient {
return l.client
}

func (l *DockerCluster) expectEvent(c *Container, msgs ...string) {
for index, ctr := range l.Nodes {
if c.id != ctr.id {
Expand Down
31 changes: 29 additions & 2 deletions pkg/ccl/acceptanceccl/cdc_kafka_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"math/rand"
"net"
"reflect"
Expand All @@ -36,17 +37,19 @@ import (
"github.com/cockroachdb/cockroach/pkg/util/retry"
"github.com/cockroachdb/cockroach/pkg/workload"
"github.com/cockroachdb/cockroach/pkg/workload/bank"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/go-connections/nat"
)

func TestCDC(t *testing.T) {
t.Skip("#28102")
s := log.Scope(t)
defer s.Close(t)

acceptance.RunDocker(t, func(t *testing.T) {
ctx := context.Background()
ctx, cancel := context.WithCancel(context.Background())
defer cancel()

cfg := acceptance.ReadConfigFromFlags()
// Should we thread the old value of cfg.Nodes to the TestCluster?
cfg.Nodes = nil
Expand All @@ -63,6 +66,30 @@ func TestCDC(t *testing.T) {
t.Fatalf(`%+v`, err)
}
defer k.Close(ctx)
go func() {
select {
case <-ctx.Done():
return
case <-time.After(time.Minute):
}
// Additional debugging in case #28102 shows up again.
logs, err := c.Client().ContainerLogs(
context.Background(),
k.serviceContainers[`kafka`].Name(),
types.ContainerLogsOptions{ShowStdout: true, ShowStderr: true},
)
if err != nil {
log.Warningf(ctx, "unable to get additional debugging: %v", err)
return
}
defer logs.Close()
logsBytes, err := ioutil.ReadAll(logs)
if err != nil {
log.Warningf(ctx, "unable to get additional debugging: %v", err)
return
}
log.Infof(ctx, "KAFKA DOCKER CONTAINER LOGS:\n%s", string(logsBytes))
}()

t.Run(`Description`, func(t *testing.T) { testDescription(ctx, t, c, k) })
t.Run(`PauseUnpause`, func(t *testing.T) { testPauseUnpause(ctx, t, c, k) })
Expand Down

0 comments on commit 66ba1f0

Please sign in to comment.