Commit 2353df0
committed
internal/middleware/stats: make TestStats more reliable
TestStats depended on having a big sleep in the middle and then
expecting that the time taken to the last byte was dominated by the
sleep time. Instead of doing that use upper and lower bounds where
possible to determine the range MillisToFirstByte and MillisToLastByte
should fall between
Fixes #61770
Change-Id: Ie266e34165670827035fb2a05e32c2aee268a2e0
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/517975
TryBot-Result: Gopher Robot <[email protected]>
Run-TryBot: Michael Matloob <[email protected]>
Reviewed-by: Bryan Mills <[email protected]>
kokoro-CI: kokoro <[email protected]>1 parent a3b12ea commit 2353df0
1 file changed
+15
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| 30 | + | |
28 | 31 | | |
29 | | - | |
| 32 | + | |
| 33 | + | |
30 | 34 | | |
31 | 35 | | |
32 | 36 | | |
33 | 37 | | |
| 38 | + | |
34 | 39 | | |
35 | 40 | | |
36 | 41 | | |
| |||
40 | 45 | | |
41 | 46 | | |
42 | 47 | | |
| 48 | + | |
43 | 49 | | |
44 | 50 | | |
45 | 51 | | |
| |||
64 | 70 | | |
65 | 71 | | |
66 | 72 | | |
67 | | - | |
68 | | - | |
69 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
70 | 76 | | |
71 | | - | |
72 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
73 | 82 | | |
74 | 83 | | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
| |||
0 commit comments