| 45 | } |
| 46 | |
| 47 | func newHarness(ctx context.Context, t *testing.T) (drivertest.Harness, error) { |
| 48 | t.Helper() |
| 49 | |
| 50 | client, err := Client(ctx, projectID, nil) |
| 51 | if err != nil { |
| 52 | return nil, fmt.Errorf("making client: %v", err) |
| 53 | } |
| 54 | return &harness{closer: func() {}, client: client, numTopics: 0, numSubs: 0}, nil |
| 55 | } |
| 56 | |
| 57 | func (h *harness) CreateTopic(ctx context.Context, testName string) (dt driver.Topic, cleanup func(), err error) { |
| 58 | topicName := fmt.Sprintf("%s-topic-%d", sanitize(testName), atomic.AddUint32(&h.numTopics, 1)) |