fix flaky tests (#1860)

This commit is contained in:
Adam Babik 2020-02-18 10:34:09 +01:00 committed by GitHub
parent 46b05c7478
commit 491e3be799
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 7 deletions

View File

@ -438,13 +438,15 @@ type RequestMessagesSyncSuite struct {
func (s *RequestMessagesSyncSuite) TestExpired() {
// intentionally discarding all requests, so that request will timeout
go func() {
msg, err := s.remoteRW.ReadMsg()
s.Require().NoError(err)
s.Require().NoError(msg.Discard())
for {
msg, err := s.remoteRW.ReadMsg()
s.Require().NoError(err)
s.Require().NoError(msg.Discard())
}
}()
_, err := s.localAPI.RequestMessagesSync(
ext.RetryConfig{
BaseTimeout: time.Second,
BaseTimeout: time.Millisecond * 100,
},
ext.MessagesRequest{
MailServerPeer: s.localNode.String(),

View File

@ -353,9 +353,11 @@ type RequestMessagesSyncSuite struct {
func (s *RequestMessagesSyncSuite) TestExpired() {
// intentionally discarding all requests, so that request will timeout
go func() {
msg, err := s.remoteRW.ReadMsg()
s.Require().NoError(err)
s.Require().NoError(msg.Discard())
for {
msg, err := s.remoteRW.ReadMsg()
s.Require().NoError(err)
s.Require().NoError(msg.Discard())
}
}()
_, err := s.localAPI.RequestMessagesSync(
ext.RetryConfig{