Skip to content

Commit

Permalink
Fixing flakey test by removing time asserts (#1658)
Browse files Browse the repository at this point in the history
  • Loading branch information
kushalmalani authored May 31, 2024
1 parent fc96bb3 commit d705171
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions version/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,7 @@ func (s *Suite) TestGithubAPITimeout() {
githubClient := github.NewClient(&http.Client{Timeout: 100 * time.Microsecond}) // client side timeout should be less than server side sleep defined above
githubClient.BaseURL = githubURL

start := time.Now()
release, err := getLatestRelease(githubClient, "test", "test")
elapsed := time.Since(start)
// assert time to get a response from the function is only slightly greater than client timeout
s.GreaterOrEqual(elapsed, 100*time.Microsecond)
s.Less(elapsed, 300*time.Microsecond)
// assert error returned is related to client timeout
s.Nil(release)
s.Error(err)
Expand Down

0 comments on commit d705171

Please sign in to comment.