mirror of
https://github.com/tailscale/tailscale.git
synced 2026-05-05 12:16:44 +02:00
WIP
Change-Id: Ie985bbc870cb79ce69ed4218c832922fcecca5c9 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
27a0168cdc
commit
713fd1d40c
@ -40,7 +40,7 @@ var publishOnce sync.Once
|
||||
// This is particularly useful because certain conditions can cause indefinite hangs
|
||||
// (such as improper dbus auth followed by contextless dbus.Object.Call).
|
||||
// Such operations should be wrapped in a timeout context.
|
||||
const reconfigTimeout = time.Second
|
||||
const reconfigTimeout = 5 * time.Second
|
||||
|
||||
// Set unless ts_omit_networkmanager
|
||||
var (
|
||||
|
||||
@ -6,14 +6,27 @@ package dns
|
||||
import (
|
||||
"errors"
|
||||
"io/fs"
|
||||
"net/netip"
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"tailscale.com/tstest"
|
||||
"tailscale.com/util/cmpver"
|
||||
"tailscale.com/util/must"
|
||||
)
|
||||
|
||||
func TestBradNetworkManager(t *testing.T) {
|
||||
m := must.Get(newNMManager("wlp3s0"))
|
||||
must.Do(m.SetDNS(OSConfig{
|
||||
Nameservers: []netip.Addr{
|
||||
netip.MustParseAddr("10.0.0.2"),
|
||||
netip.MustParseAddr("10.0.0.3"),
|
||||
},
|
||||
}))
|
||||
t.Logf("done")
|
||||
}
|
||||
|
||||
func TestLinuxDNSMode(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
|
||||
@ -245,6 +245,9 @@ func (s *Subscriber[T]) dispatch(ctx context.Context, vals *queue[DeliveredEvent
|
||||
case <-s.slow.C:
|
||||
s.logf("subscriber for %T is slow (%v elapsed)", t, time.Since(start))
|
||||
s.slow.Reset(slowSubscriberTimeout)
|
||||
all := make([]byte, 2<<20)
|
||||
n := runtime.Stack(all, true)
|
||||
panic("TOO SLOW: " + string(all[:n]))
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -344,6 +347,9 @@ func (s *SubscriberFunc[T]) dispatch(ctx context.Context, vals *queue[DeliveredE
|
||||
case <-s.slow.C:
|
||||
s.logf("subscriber for %T is slow (%v elapsed)", t, time.Since(start))
|
||||
s.slow.Reset(slowSubscriberTimeout)
|
||||
all := make([]byte, 2<<20)
|
||||
n := runtime.Stack(all, true)
|
||||
panic("TOO SLOW: " + string(all[:n]))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user