@ -345,7 +345,6 @@ func TestConfigFileAuthKey(t *testing.T) {
func TestTwoNodes ( t * testing . T ) {
func TestTwoNodes ( t * testing . T ) {
tstest . Shard ( t )
tstest . Shard ( t )
flakytest . Mark ( t , "https://github.com/tailscale/tailscale/issues/3598" )
tstest . Parallel ( t )
tstest . Parallel ( t )
env := newTestEnv ( t )
env := newTestEnv ( t )
@ -400,7 +399,6 @@ func TestTwoNodes(t *testing.T) {
// PeersRemoved set) saying that the second node disappeared.
// PeersRemoved set) saying that the second node disappeared.
func TestIncrementalMapUpdatePeersRemoved ( t * testing . T ) {
func TestIncrementalMapUpdatePeersRemoved ( t * testing . T ) {
tstest . Shard ( t )
tstest . Shard ( t )
flakytest . Mark ( t , "https://github.com/tailscale/tailscale/issues/3598" )
tstest . Parallel ( t )
tstest . Parallel ( t )
env := newTestEnv ( t )
env := newTestEnv ( t )
@ -658,17 +656,14 @@ func TestNoControlConnWhenDown(t *testing.T) {
d2 := n1 . StartDaemon ( )
d2 := n1 . StartDaemon ( )
n1 . AwaitResponding ( )
n1 . AwaitResponding ( )
st := n1 . MustStatus ( )
n1 . AwaitBackendState ( "Stopped" )
if got , want := st . BackendState , "Stopped" ; got != want {
t . Fatalf ( "after restart, state = %q; want %q" , got , want )
}
ip2 := n1 . AwaitIP4 ( )
ip2 := n1 . AwaitIP4 ( )
if ip1 != ip2 {
if ip1 != ip2 {
t . Errorf ( "IPs different: %q vs %q" , ip1 , ip2 )
t . Errorf ( "IPs different: %q vs %q" , ip1 , ip2 )
}
}
// The real test: verify our daemon doesn't have an HTTP request open. :
// The real test: verify our daemon doesn't have an HTTP request open.
if n := env . Control . InServeMap ( ) ; n != 0 {
if n := env . Control . InServeMap ( ) ; n != 0 {
t . Errorf ( "in serve map = %d; want 0" , n )
t . Errorf ( "in serve map = %d; want 0" , n )
}
}
@ -1007,7 +1002,6 @@ func newTestEnv(t testing.TB, opts ...testEnvOpt) *testEnv {
if runtime . GOOS == "windows" {
if runtime . GOOS == "windows" {
t . Skip ( "not tested/working on Windows yet" )
t . Skip ( "not tested/working on Windows yet" )
}
}
flakytest . Mark ( t , "https://github.com/tailscale/tailscale/issues/7036" )
derpMap := RunDERPAndSTUN ( t , logger . Discard , "127.0.0.1" )
derpMap := RunDERPAndSTUN ( t , logger . Discard , "127.0.0.1" )
logc := new ( LogCatcher )
logc := new ( LogCatcher )
control := & testcontrol . Server {
control := & testcontrol . Server {
@ -1389,6 +1383,10 @@ func (n *testNode) AwaitIP6() netip.Addr {
// AwaitRunning waits for n to reach the IPN state "Running".
// AwaitRunning waits for n to reach the IPN state "Running".
func ( n * testNode ) AwaitRunning ( ) {
func ( n * testNode ) AwaitRunning ( ) {
n . AwaitBackendState ( "Running" )
}
func ( n * testNode ) AwaitBackendState ( state string ) {
t := n . env . t
t := n . env . t
t . Helper ( )
t . Helper ( )
if err := tstest . WaitFor ( 20 * time . Second , func ( ) error {
if err := tstest . WaitFor ( 20 * time . Second , func ( ) error {
@ -1396,8 +1394,8 @@ func (n *testNode) AwaitRunning() {
if err != nil {
if err != nil {
return err
return err
}
}
if st . BackendState != "Running" {
if st . BackendState != state {
return fmt . Errorf ( "in state %q ", st . BackendS tate)
return fmt . Errorf ( "in state %q ; want %q ", st . BackendS tate, s tate)
}
}
return nil
return nil
} ) ; err != nil {
} ) ; err != nil {