Skip to content

Commit

Permalink
remove dead code and other fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
skonto committed Nov 1, 2023
1 parent fd8f461 commit 8994b23
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 12 deletions.
8 changes: 4 additions & 4 deletions pkg/activator/net/throttler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -741,10 +741,10 @@ func TestActivatorsIndexUpdate(t *testing.T) {
}()

possibleDests := sets.NewString("128.0.0.1:1234", "128.0.0.2:1234", "128.0.0.23:1234")
updateCh <- (revisionDestsUpdate{
updateCh <- revisionDestsUpdate{
Rev: revID,
Dests: possibleDests,
})
}

// Add activator endpoint with 2 activators.
publicEp := &corev1.Endpoints{
Expand Down Expand Up @@ -837,10 +837,10 @@ func TestMultipleActivators(t *testing.T) {

revID := types.NamespacedName{Namespace: testNamespace, Name: testRevision}
possibleDests := sets.NewString("128.0.0.1:1234", "128.0.0.2:1234", "128.0.0.23:1234")
updateCh <- (revisionDestsUpdate{
updateCh <- revisionDestsUpdate{
Rev: revID,
Dests: possibleDests,
})
}

// Add activator endpoint with 2 activators.
publicEp := &corev1.Endpoints{
Expand Down
1 change: 0 additions & 1 deletion pkg/http/handler/timeout_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,6 @@ func TestIdleTimeoutHandler(t *testing.T) {

func TestTimeoutHandler(t *testing.T) {
const (
noTimeout = 0 * time.Millisecond
immediateTimeout = 1 * time.Millisecond
shortTimeout = 100 * time.Millisecond
longTimeout = 1 * time.Minute
Expand Down
2 changes: 1 addition & 1 deletion pkg/reconciler/revision/background_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ func TestRateLimitPerItem(t *testing.T) {

latency := time.Since(start)
// no delay on first resolve
expected := (time.Duration(math.Pow(2, float64(i-1))) * baseDelay)
expected := time.Duration(math.Pow(2, float64(i-1))) * baseDelay
if latency < expected {
t.Fatalf("latency = %s, want at least %s", latency, expected)
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/reconciler/route/traffic/rollout.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,12 +280,12 @@ func adjustPercentage(goal int, cr *ConfigurationRollout, logger *zap.SugaredLog
cr.Revisions = nil // No traffic, no rollout.
case diff > 0:
logger.Infof("Traffic for config %s increased by %d%%, assigning the difference to the latest revision",
cr.ConfigurationName)
cr.ConfigurationName, diff)
cr.Revisions[len(cr.Revisions)-1].Percent += diff
case diff < 0:
diff = -diff // To make logic more natural.
logger.Infof("Traffic for config %s decreased by %d%%, removing the difference from the oldest revision(s)",
cr.ConfigurationName)
cr.ConfigurationName, diff)
i := 0
for diff > 0 && i < len(cr.Revisions) {
if cr.Revisions[i].Percent > diff {
Expand Down
2 changes: 0 additions & 2 deletions pkg/reconciler/route/traffic/rollout_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1011,9 +1011,7 @@ func TestObserveReady(t *testing.T) {
const (
now = 200620092020 + 1982
oldenDays = 198219841988
oldenStep = float64(now-oldenDays) / float64(time.Second)
ancientDays = 14921812
ancientStep = float64(now-ancientDays) / float64(time.Second)
duration = 120.
)
ro := Rollout{
Expand Down
2 changes: 0 additions & 2 deletions test/conformance.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,13 @@ const (
InvalidHelloWorld = "invalidhelloworld" // Not a real image
PizzaPlanet1 = "pizzaplanetv1"
PizzaPlanet2 = "pizzaplanetv2"
Protocols = "protocols"
Readiness = "readiness"
Runtime = "runtime"
ServingContainer = "servingcontainer"
SidecarContainer = "sidecarcontainer"
SingleThreadedImage = "singlethreaded"
Timeout = "timeout"
Volumes = "volumes"
WorkingDir = "workingdir"
SlowStart = "slowstart"

// Constants for test image output.
Expand Down

0 comments on commit 8994b23

Please sign in to comment.