-
Notifications
You must be signed in to change notification settings - Fork 86
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
Coalesce timers to improve relay performance #545
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
sudo: false | ||
sudo: true | ||
language: go | ||
|
||
cache: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,13 +18,17 @@ | |
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
// THE SOFTWARE. | ||
|
||
package tchannel | ||
package tchannel_test | ||
|
||
import ( | ||
"testing" | ||
"time" | ||
|
||
"github.com/stretchr/testify/assert" | ||
"github.com/stretchr/testify/require" | ||
|
||
. "github.com/uber/tchannel-go" | ||
"github.com/uber/tchannel-go/testutils" | ||
) | ||
|
||
func TestAllChannelsRegistered(t *testing.T) { | ||
|
@@ -42,6 +46,8 @@ func TestAllChannelsRegistered(t *testing.T) { | |
assert.Equal(t, 1, len(state.OtherChannels["ch2"])) | ||
|
||
ch1_2.Close() | ||
// TODO: replace this sleep with a callback hook. | ||
time.Sleep(testutils.Timeout(10 * time.Millisecond)) | ||
|
||
state = ch1_1.IntrospectState(introspectOpts) | ||
assert.Equal(t, 0, len(state.OtherChannels["ch1"])) | ||
|
@@ -57,6 +63,8 @@ func TestAllChannelsRegistered(t *testing.T) { | |
ch1_1.Close() | ||
ch2_1.Close() | ||
ch2_2.Close() | ||
// TODO: replace this sleep with a callback hook. | ||
time.Sleep(testutils.Timeout(10 * time.Millisecond)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why the sleeps? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since we moved Since this is the only place we're relying upon the current behavior, I opted to make these tests uglier instead of making the production code more complex. Alternatively, I can keep the call to |
||
|
||
state = ch1_1.IntrospectState(introspectOpts) | ||
assert.Equal(t, 0, len(state.OtherChannels["ch1"])) | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
Are these changes only for the
Sleep
after closing the channels?If we need to keep this, can we dot import "tchannel-go" like in other tests, so that the test code itself doesn't change.
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.
Yep, just for the sleep with testutils. Happy to dot-import.