Skip to content
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

Fix atomic usage in tests #6964

Merged
merged 1 commit into from
Jan 31, 2020
Merged

Fix atomic usage in tests #6964

merged 1 commit into from
Jan 31, 2020

Conversation

danielnelson
Copy link
Contributor

related: #6960

Required for all PRs:

  • Signed CLA.
  • Associated README.md updated.
  • Has appropriate unit tests.

@danielnelson danielnelson added this to the 1.14.0 milestone Jan 31, 2020
@@ -246,7 +246,7 @@ type TestAggregator struct {
func (t *TestAggregator) Description() string { return "" }
func (t *TestAggregator) SampleConfig() string { return "" }
func (t *TestAggregator) Reset() {
atomic.StoreInt64(&t.sum, 0)
t.sum := 0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Atomic not be required, the RunningAggregator should prevent concurrent calls.

@@ -230,36 +227,6 @@ func TestParseConfig(t *testing.T) {
require.NotNil(t, tab)
}

func TestThrottledExecutor(t *testing.T) {
Copy link
Contributor Author

@danielnelson danielnelson Jan 31, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is racy and somewhat slow to run, I don't think it provides enough value to keep. FYI @prydin

@danielnelson danielnelson requested a review from reimda January 31, 2020 21:49
@danielnelson danielnelson merged commit 38bc81e into master Jan 31, 2020
@danielnelson danielnelson deleted the fix-atomic-usage branch January 31, 2020 22:14
athoune pushed a commit to bearstech/telegraf that referenced this pull request Apr 17, 2020
idohalevi pushed a commit to idohalevi/telegraf that referenced this pull request Sep 29, 2020
arstercz pushed a commit to arstercz/telegraf that referenced this pull request Mar 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants