ocket8888 commented on a change in pull request #4966:
URL: https://github.com/apache/trafficcontrol/pull/4966#discussion_r478916668
##########
File path: traffic_ops/testing/api/v3/servers_test.go
##########
@@ -166,24 +166,54 @@ func GetTestServersQueryParameters(t *testing.T) {
params := url.Values{}
params.Add("dsId", strconv.Itoa(*ds.ID))
- _, _, err = TOSession.GetServers(¶ms)
+ _, _, err = TOSession.GetServersWithHdr(¶ms, nil)
if err != nil {
t.Fatalf("Failed to get server by Delivery Service ID: %v", err)
}
currentTime := time.Now().UTC().Add(5 * time.Second)
- time := currentTime.Format(time.RFC1123)
+ timestamp := currentTime.Format(time.RFC1123)
var header http.Header
header = make(map[string][]string)
- header.Set(rfc.IfModifiedSince, time)
+ header.Set(rfc.IfModifiedSince, timestamp)
_, reqInf, _ := TOSession.GetServersWithHdr(¶ms, header)
if reqInf.StatusCode != http.StatusNotModified {
t.Errorf("Expected a status code of 304, got %v",
reqInf.StatusCode)
}
+ foundTopDs := false
+ const topDsXmlId = "ds-top"
+ for _, ds = range dses {
+ if ds.XMLID != nil && *ds.XMLID != topDsXmlId {
+ continue
+ }
+ foundTopDs = true
+ break
Review comment:
idk if this logic makes sense. So if you get a Delivery Service with a
nil XMLID it's the `ds-top` DS?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]