Skip to content
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

Remove dead code and other fixes #14578

Merged
merged 1 commit into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading