mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-24 09:39:39 +00:00
net/netcheck,wgengine/magicsock: align DERP frame receive time heuristics
The netcheck package and the magicksock package coordinate via the health package, but both sides have time based heuristics through indirect dependencies. These were misaligned, so the implemented heuristic aimed at reducing DERP moves while there is active traffic were non-operational about 3/5ths of the time. It is problematic to setup a good test for this integration presently, so instead I added comment breadcrumbs along with the initial fix. Updates #8603 Signed-off-by: James Tucker <james@tailscale.com>
This commit is contained in:
committed by
James Tucker
parent
1fbaf26106
commit
6e334e64a1
@@ -410,7 +410,7 @@ func TestAddReportHistoryAndSetPreferredDERP(t *testing.T) {
|
||||
},
|
||||
opts: &GetReportOpts{
|
||||
GetLastDERPActivity: mkLDAFunc(map[int]time.Time{
|
||||
1: startTime.Add(2*time.Second + preferredDERPFrameTime/2), // within active window of step (3)
|
||||
1: startTime.Add(2*time.Second + PreferredDERPFrameTime/2), // within active window of step (3)
|
||||
}),
|
||||
},
|
||||
wantPrevLen: 3,
|
||||
@@ -425,7 +425,7 @@ func TestAddReportHistoryAndSetPreferredDERP(t *testing.T) {
|
||||
},
|
||||
opts: &GetReportOpts{
|
||||
GetLastDERPActivity: mkLDAFunc(map[int]time.Time{
|
||||
1: startTime.Add(4*time.Second - preferredDERPFrameTime - 1), // not within active window of (3)
|
||||
1: startTime.Add(4*time.Second - PreferredDERPFrameTime - 1), // not within active window of (3)
|
||||
}),
|
||||
},
|
||||
wantPrevLen: 3,
|
||||
|
||||
Reference in New Issue
Block a user