Skip to content

Commit dc46b55

Browse files
authored
GT-123 Adjust TestServerStatisticsForwarding with ArangoDB 3.10 (#410)
1 parent dedffd0 commit dc46b55

File tree

1 file changed

+15
-22
lines changed

1 file changed

+15
-22
lines changed

test/server_statistics_test.go

+15-22
Original file line numberDiff line numberDiff line change
@@ -257,11 +257,6 @@ func TestServerStatisticsForwarding(t *testing.T) {
257257

258258
time.Sleep(time.Second) // wait for statistics to settle
259259

260-
statsBefore, err := c.Statistics(ctx2)
261-
if err != nil {
262-
t.Fatalf("Error in statistics call: %s", describe(err))
263-
}
264-
265260
// At least 5000 documents in the collection:
266261
doSomeWrites(t, ctx1, c)
267262
doSomeWrites(t, ctx1, c)
@@ -277,9 +272,12 @@ func TestServerStatisticsForwarding(t *testing.T) {
277272
}
278273

279274
// No traffic on second coordinator (besides statistics calls):
280-
checkTrafficAtMost(t, &statsBefore, &statsAfter, all,
281-
&limits{Recv: 400, Sent: 4000,
282-
RecvCount: 2, SentCount: 2}, "Pear")
275+
// UPDATE: since 3.10 there a lot more traffic between the servers (metrics scrape) than just the statistics calls - we don't want to check for that here.
276+
/*
277+
checkTrafficAtMost(t, &statsBefore, &statsAfter, all,
278+
&limits{Recv: 400, Sent: 4000,
279+
RecvCount: 2, SentCount: 2}, "Pear")
280+
*/
283281

284282
if statsAfter.ClientUser.BytesReceived.Counts == nil {
285283
t.Skip("Skipping ClientUser tests for statistics, since API is not present.")
@@ -313,10 +311,6 @@ func TestServerStatisticsForwarding(t *testing.T) {
313311
if err != nil {
314312
t.Fatalf("Error in statistics call: %s", describe(err))
315313
}
316-
statsBefore2, err := c.Statistics(ctx2)
317-
if err != nil {
318-
t.Fatalf("Error in statistics call: %s", describe(err))
319-
}
320314

321315
// Now issue a cursor continuation call to the second coordinator:
322316
req, err = conn.NewRequest("PUT", "_db/statistics_test/_api/cursor/"+cursorBody.ID)
@@ -334,17 +328,16 @@ func TestServerStatisticsForwarding(t *testing.T) {
334328
if err != nil {
335329
t.Fatalf("Error in statistics call: %s", describe(err))
336330
}
337-
statsAfter2, err := c.Statistics(ctx2)
338-
if err != nil {
339-
t.Fatalf("Error in statistics call: %s", describe(err))
340-
}
341331

342-
// Second coordinator should not count as user traffic (besides maybe
343-
// the statistics calls):
344-
t.Logf("Checking user traffic on coordinator2...")
345-
checkTrafficAtMost(t, &statsBefore2, &statsAfter2, user,
346-
&limits{Recv: 400, Sent: 4000,
347-
RecvCount: 2, SentCount: 2}, "Apricot")
332+
// @deprecated Second coordinator should not count as user traffic (besides maybe the statistics calls)
333+
// UPDATE: since 3.10 there a lot more traffic between the servers (metrics scrape) than just the statistics calls - we don't want to check for that here.
334+
/*
335+
t.Logf("Checking user traffic on coordinator2...")
336+
checkTrafficAtMost(t, &statsBefore2, &statsAfter2, user,
337+
&limits{Recv: 400, Sent: 4000,
338+
RecvCount: 2, SentCount: 2}, "Apricot")
339+
*/
340+
348341
// However, first coordinator should have counted the user traffic,
349342
// note: it was just a single request with nearly no upload but quite
350343
// some download:

0 commit comments

Comments
 (0)