-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
remove sleep from tests #2555
remove sleep from tests #2555
Conversation
Tests are unfortunately failing on the tail input plugin. The github.com/hpcloud/tail package is racy as hell. Am going to try to submit a patch on it to fix some of the more critical issues. But I can't even get that package's own tests to pass on my system (even on a completely unmodified master), so it might take a little work. |
We could merge everything except the tail changes now, and fix those tests later. |
@@ -60,13 +59,19 @@ func TestTailFromEnd(t *testing.T) { | |||
|
|||
acc := testutil.Accumulator{} | |||
require.NoError(t, tt.Start(&acc)) | |||
time.Sleep(time.Millisecond * 100) | |||
time.Sleep(time.Millisecond * 200) //TODO remove once https://github.com/hpcloud/tail/pull/114 is merged & added to Godeps |
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.
This solves the race detector issues.
@phemmer Getting lots of failures over the last few days from the tail tests, any sense on if this might be fixed by your upstream fix? https://circleci.com/gh/influxdata/telegraf/6404 |
Hrm. Looks different. Still a race condition, but I don't think related to my upstream PR. Will look into it later tonight.
…-------- Original Message --------
From: Daniel Nelson <notifications@github.com>
Sent: March 21, 2017 7:16:27 PM EDT
To: influxdata/telegraf <telegraf@noreply.github.com>
Cc: Patrick Hemmer <patrick@stormcloud9.net>, Author <author@noreply.github.com>
Subject: Re: [influxdata/telegraf] remove sleep from tests (#2555)
We could merge everything except the tail changes now, and fix those tests later.
--
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#2555 (comment)
--
Sent via mobile
|
That library is so incredibly messy. If there were an alternative available, I'd recommend switching. But I find no alternatives. Looking at the history of the project, PRs seem to take months to merge. The last PR took 5 months to merge in, and there were no changes that had to be made during review process. |
I think we will have to use a fork at least until your changes are accepted. Would you rather merge both of your changes onto a single branch on your fork or should I make one on our organization? |
I think I would prefer it be part of influxdata, or an official member of the team :-) |
Can you open the PRs on https://github.com/influxdata/tail. I really appreciate all the help, you are official to me but perhaps not to the legal team ;) |
This removes
time.Sleep()
from the majority of the tests. This should alleviate the racyness that causes the CircleCI tests to randomly fail. It also makes the affected tests significantly faster.The few tests where
time.Sleep()
wasn't removed generally one of 2 cases. Either doing so would have made the code very complex, or I don't have the ability to test the change.Required for all PRs:
Fixes #2382