Skip to content

Commit

Permalink
fix(e2e): Removes workaround for ensuring LCR=LRR at client side
Browse files Browse the repository at this point in the history
 Related to knative#500

 - The fix for serving#6060 merged (serving#6069), removing the workaround
   at client side e2e tests for additional LCR=LRR check after service update return.
 - Now we expect service status to have LCR=LRR if the service's conditions turned True after last update.
  • Loading branch information
navidshaikh committed Nov 28, 2019
1 parent 0efde62 commit fc14d39
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions test/e2e/traffic_split_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"strconv"
"strings"
"testing"
"time"

"gotest.tools/assert"
"knative.dev/client/pkg/util"
Expand All @@ -34,9 +33,6 @@ var targetFieldsLength = 4
// returns deployed service targets separated by '|' and each target fields seprated by comma
var targetsJsonPath = "jsonpath={range .status.traffic[*]}{.tag}{','}{.revisionName}{','}{.percent}{','}{.latestRevision}{'|'}{end}"

var lcrJsonPath = "jsonpath={.status.latestCreatedRevisionName}"
var lrrJsonPath = "jsonpath={.status.latestReadyRevisionName}"

// TargetFields are used in e2e to store expected fields per traffic target
// and actual traffic targets fields of deployed service are converted into struct before comparing
type TargetFields struct {
Expand Down Expand Up @@ -366,24 +362,7 @@ func TestTrafficSplit(t *testing.T) {
)
}

// TODO: Remove after serving/issue#6060 is fixed
// Since service update request has returned (True), lets retry 5 times
// with 2 seconds delay to ensure LCR = LRR, fail otherwise
func (test *e2eTest) ensureLRREqualToLCR(t *testing.T, serviceName string) {
for i := 0; i < 5; i++ {
lcr := test.serviceDescribeWithJsonPath(t, serviceName, lcrJsonPath)
lrr := test.serviceDescribeWithJsonPath(t, serviceName, lrrJsonPath)
if lcr == lrr {
return
}
time.Sleep(time.Second * 2)
}
}

func (test *e2eTest) verifyTargets(t *testing.T, serviceName string, expectedTargets []TargetFields) {
// TODO: Workaround for serving/issue#6060, remove as fixed
test.ensureLRREqualToLCR(t, serviceName)

out := test.serviceDescribeWithJsonPath(t, serviceName, targetsJsonPath)
assert.Check(t, out != "")
actualTargets, err := splitTargets(out, targetsSeparator, len(expectedTargets))
Expand Down

0 comments on commit fc14d39

Please sign in to comment.