-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add more test cases for sharding strategy #160
Conversation
currentShardCount: 3, | ||
timeSeries: float64(0), | ||
expected: 3, | ||
}, | ||
}, | ||
}, | ||
} | ||
|
||
func TestShardComputationLogic(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove parallèl?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need for parallel execution here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well yes, improving speed 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with t.Parallel
$ time go test ./pkg/monitoring/prometheusagent/sharding/
ok github.com/giantswarm/observability-operator/pkg/monitoring/prometheusagent/sharding (cached)
go test ./pkg/monitoring/prometheusagent/sharding/ 0,11s user 0,05s system 192% cpu 0,084 total
without t.Parallel
$ time go test ./pkg/monitoring/prometheusagent/sharding/
ok github.com/giantswarm/observability-operator/pkg/monitoring/prometheusagent/sharding (cached)
go test ./pkg/monitoring/prometheusagent/sharding/ 0,11s user 0,08s system 175% cpu 0,104 total
I see no speed improvement, and even then tests do not need such "optimization". t.Parallel is also meant to be used in order to spot race conditions rather than improving speed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well I disagree that tests should not run on parallel for ci costs and Time but hère they are probably not relevant
Towards: giantswarm/roadmap#3724
Adding more test cases for sharding strategy to cover more scenarios.