Skip to content

Commit eace67d

Browse files
committed
test: increase timeout for test execution and add cleanup for Trino container specs
1 parent 388ada0 commit eace67d

File tree

2 files changed

+38
-2
lines changed

2 files changed

+38
-2
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ test-short:
3636
test:
3737
@-rm -r $(COVERAGE_DIR)
3838
@mkdir $(COVERAGE_DIR)
39-
make test-with-flags TEST_FLAGS='-v -race -covermode atomic -coverprofile $$(COVERAGE_DIR)/combined.txt -bench=. -benchmem -timeout 20m'
39+
make test-with-flags TEST_FLAGS='-v -race -covermode atomic -coverprofile $$(COVERAGE_DIR)/combined.txt -bench=. -benchmem -timeout 30m'
4040

4141

4242
test-with-flags:

database/trino/trino_test.go

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,45 @@ func isReady(ctx context.Context, c dktest.ContainerInfo) bool {
117117

118118
func Test(t *testing.T) {
119119
t.Run("test", test)
120+
121+
t.Cleanup(func() {
122+
for _, spec := range specs {
123+
t.Log("Cleaning up ", spec.ImageName)
124+
if err := spec.Cleanup(); err != nil {
125+
t.Error("Error removing ", spec.ImageName, "error:", err)
126+
}
127+
}
128+
})
129+
}
130+
131+
func TestOpen(t *testing.T) {
132+
t.Run("testOpen", testOpen)
133+
134+
t.Cleanup(func() {
135+
for _, spec := range specs {
136+
t.Log("Cleaning up ", spec.ImageName)
137+
if err := spec.Cleanup(); err != nil {
138+
t.Error("Error removing ", spec.ImageName, "error:", err)
139+
}
140+
}
141+
})
142+
}
143+
144+
func TestMigrate(t *testing.T) {
120145
t.Run("testMigrate", testMigrate)
146+
147+
t.Cleanup(func() {
148+
for _, spec := range specs {
149+
t.Log("Cleaning up ", spec.ImageName)
150+
if err := spec.Cleanup(); err != nil {
151+
t.Error("Error removing ", spec.ImageName, "error:", err)
152+
}
153+
}
154+
})
155+
}
156+
157+
func TestWithInstance(t *testing.T) {
121158
t.Run("testWithInstance", testWithInstance)
122-
t.Run("testOpen", testOpen)
123159

124160
t.Cleanup(func() {
125161
for _, spec := range specs {

0 commit comments

Comments
 (0)