Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
48e80cce65 |
@@ -494,10 +494,12 @@ func TestStatsAnswerGivesConnectionDurationInSeconds(t *testing.T) {
|
|||||||
// TestStreamDurationsCountSeconds checks that the uptime and the connection
|
// TestStreamDurationsCountSeconds checks that the uptime and the connection
|
||||||
// duration of a stream that connected 90 seconds ago are both 90. A stream
|
// duration of a stream that connected 90 seconds ago are both 90. A stream
|
||||||
// that has never connected has an uptime of 0, and one that is not connected
|
// that has never connected has an uptime of 0, and one that is not connected
|
||||||
// has no connection duration.
|
// has no connection duration. The test runs in a synctest bubble, whose clock
|
||||||
|
// is fake, so a stall on the host does not add to the 90 seconds.
|
||||||
func TestStreamDurationsCountSeconds(t *testing.T) {
|
func TestStreamDurationsCountSeconds(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
|
synctest.Test(t, func(t *testing.T) {
|
||||||
const connectedFor = 90 * time.Second
|
const connectedFor = 90 * time.Second
|
||||||
|
|
||||||
connectedSince := time.Now().Add(-connectedFor)
|
connectedSince := time.Now().Add(-connectedFor)
|
||||||
@@ -522,6 +524,7 @@ func TestStreamDurationsCountSeconds(t *testing.T) {
|
|||||||
t.Errorf("connectionDurationSeconds while not connected = %d, want nil",
|
t.Errorf("connectionDurationSeconds while not connected = %d, want nil",
|
||||||
*got)
|
*got)
|
||||||
}
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// newTestTable returns a routing table that holds a route for testPrefixV4,
|
// newTestTable returns a routing table that holds a route for testPrefixV4,
|
||||||
|
|||||||
Reference in new issue
Block a user