Skip to content

Commit a08e940

Browse files
0xgoudapashagolub
authored andcommitted
Drop all tables for builtin metrics to avoid timeout.
1 parent f840387 commit a08e940

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

internal/sinks/postgres_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,13 @@ func Test_MaintainUniqueSources_DeleteOldPartitions(t *testing.T) {
668668
pgw, err := NewPostgresWriter(ctx, connStr, opts)
669669
r.NoError(err)
670670

671+
// Drop tables for all builtin metrics to avoid timeout in
672+
// in `MaintainUniqueSources` test.
673+
for _, metric := range metrics.GetDefaultBuiltInMetrics() {
674+
_, err = pgw.sinkDb.Exec(pgw.ctx, fmt.Sprintf("DROP TABLE %s;", metric))
675+
a.NoError(err)
676+
}
677+
671678
t.Run("MaintainUniqueSources", func(_ *testing.T) {
672679
// creates an empty metric table and adds
673680
// an entry to `admin.all_distinct_dbname_metrics`

0 commit comments

Comments
 (0)