mirror of
https://github.com/tailscale/tailscale.git
synced 2025-04-21 14:11:56 +00:00
wgengine/magicsock: move device close to uncursed portion of test.
Device close used to suffer from deadlocks, but no longer. Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
parent
a265d7cbff
commit
592fec7606
@ -389,6 +389,7 @@ func TestTwoDevicePing(t *testing.T) {
|
|||||||
if err := dev1.Reconfig(&cfgs[0]); err != nil {
|
if err := dev1.Reconfig(&cfgs[0]); err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
defer dev1.Close()
|
||||||
|
|
||||||
tun2 := tuntest.NewChannelTUN()
|
tun2 := tuntest.NewChannelTUN()
|
||||||
dev2 := device.NewDevice(tun2.TUN(), &device.DeviceOptions{
|
dev2 := device.NewDevice(tun2.TUN(), &device.DeviceOptions{
|
||||||
@ -398,6 +399,7 @@ func TestTwoDevicePing(t *testing.T) {
|
|||||||
SkipBindUpdate: true,
|
SkipBindUpdate: true,
|
||||||
})
|
})
|
||||||
dev2.Up()
|
dev2.Up()
|
||||||
|
defer dev2.Close()
|
||||||
|
|
||||||
if err := dev2.Reconfig(&cfgs[1]); err != nil {
|
if err := dev2.Reconfig(&cfgs[1]); err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
@ -460,8 +462,6 @@ func TestTwoDevicePing(t *testing.T) {
|
|||||||
if os.Getenv("RUN_CURSED_TESTS") == "" {
|
if os.Getenv("RUN_CURSED_TESTS") == "" {
|
||||||
t.Skip("test is very broken, don't run in CI until it's reliable.")
|
t.Skip("test is very broken, don't run in CI until it's reliable.")
|
||||||
}
|
}
|
||||||
defer dev1.Close() // TODO(crawshaw): this hangs
|
|
||||||
defer dev2.Close() // TODO(crawshaw): this hangs
|
|
||||||
|
|
||||||
pingSeq := func(t *testing.T, count int, totalTime time.Duration, strict bool) {
|
pingSeq := func(t *testing.T, count int, totalTime time.Duration, strict bool) {
|
||||||
msg := func(i int) []byte {
|
msg := func(i int) []byte {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user