cortex icon indicating copy to clipboard operation
cortex copied to clipboard

Slow unit tests

Open pstibrany opened this issue 4 years ago • 2 comments

Some of our tests are slow. Here is list of packages with tests that run above 5 seconds (from https://github.com/cortexproject/cortex/runs/2054589567 run).

227.510s    github.com/cortexproject/cortex/pkg/ring
213.005s    github.com/cortexproject/cortex/pkg/querier
60.907s github.com/cortexproject/cortex/pkg/ingester
60.674s github.com/cortexproject/cortex/pkg/storegateway
42.779s github.com/cortexproject/cortex/pkg/chunk
39.780s github.com/cortexproject/cortex/pkg/chunk/encoding
39.727s github.com/cortexproject/cortex/pkg/ring/kv/memberlist
31.959s github.com/cortexproject/cortex/pkg/distributor
30.898s github.com/cortexproject/cortex/pkg/alertmanager
25.667s github.com/cortexproject/cortex/tools/blocksconvert/builder
23.770s github.com/cortexproject/cortex/pkg/chunk/purger
23.678s github.com/cortexproject/cortex/pkg/compactor
22.412s github.com/cortexproject/cortex/pkg/util
12.049s github.com/cortexproject/cortex/pkg/util/services
11.433s github.com/cortexproject/cortex/pkg/util/tls/test
8.013s  github.com/cortexproject/cortex/pkg/storage/tsdb/bucketindex
7.349s  github.com/cortexproject/cortex/pkg/chunk/storage

If we can optimize some of these, that would be great.

pstibrany avatar Mar 08 '21 08:03 pstibrany

This issue has been automatically marked as stale because it has not had any activity in the past 60 days. It will be closed in 15 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 06 '21 15:06 stale[bot]

Still valid, help wanted!

pracucci avatar Jun 08 '21 13:06 pracucci

@bboreham @pracucci @yeya24 I've written some simple unit tests before so I can give this a try :) Please correct me if I sound vague, would adding t.parallel() to the tests, help in this case?

moki1202 avatar Feb 09 '23 10:02 moki1202

yes @moki1202 , that would help see for example https://github.com/cortexproject/cortex/pull/5076

friedrichg avatar Feb 14 '23 17:02 friedrichg

I can take this issue then :)

moki1202 avatar Feb 14 '23 20:02 moki1202