Skip to content

Commit

Permalink
Skip due to poor Actions consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanratcliffe committed May 13, 2022
1 parent 948222a commit 75250eb
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions performance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package discovery
import (
"context"
"math"
"os"
"sync"
"testing"
"time"
Expand Down Expand Up @@ -71,6 +72,10 @@ func (s *SlowSource) Weight() int {
}

func TestParallelRequestPerformance(t *testing.T) {
if os.Getenv("GITHUB_ACTIONS") != "" {
t.Skip("Performance tests under github actions are too unreliable")
}

// This test is designed to ensure that request duration is linear up to a
// certain point. Above that point the overhead caused by having so many
// goroutines running will start to make the response times non-linear which
Expand Down Expand Up @@ -134,12 +139,8 @@ func TimeRequests(numRequests int, linkDepth int, numParallel int) TimedResults
for i := 0; i <= linkDepth; i++ {
thisLayer := int(math.Pow(2, float64(i))) * numRequests

// Expect that it'll take no longer that 200% of the sleep time. This is
// actually quite a lot of slack, and you likely won't need this much
// when running tests locally. But testing on shared platforms like
// Github actions you can see some pretty serious slowdowns that don't
// seem to be related to the tests
thisDuration := 200 * math.Ceil(float64(thisLayer)/float64(numParallel))
// Expect that it'll take no longer that 120% of the sleep time.
thisDuration := 120 * math.Ceil(float64(thisLayer)/float64(numParallel))
expectedDuration = expectedDuration + (time.Duration(thisDuration) * time.Millisecond)
expectedItems = expectedItems + thisLayer
}
Expand Down

0 comments on commit 75250eb

Please sign in to comment.