()
| 118 | } |
| 119 | |
| 120 | func terminatePubSubContainer() error { |
| 121 | if unsetErr := os.Unsetenv("PUBSUB_EMULATOR_HOST"); unsetErr != nil { |
| 122 | return fmt.Errorf("failed to unset env. %s", unsetErr.Error()) |
| 123 | } |
| 124 | pubsubClient.Close() |
| 125 | if err := pubsubContainer.Terminate(context.Background()); err != nil { |
| 126 | return fmt.Errorf("failed to terminate datastore. %s", err.Error()) |
| 127 | } |
| 128 | |
| 129 | return nil |
| 130 | } |
| 131 | |
| 132 | func createTestTopic(t *testing.T, topicID string) { |
| 133 | ctx := context.Background() |