| 1022 | } |
| 1023 | |
| 1024 | func (n *TestNode) AwaitBackendState(state string) { |
| 1025 | t := n.env.t |
| 1026 | t.Helper() |
| 1027 | if err := tstest.WaitFor(20*time.Second, func() error { |
| 1028 | st, err := n.Status() |
| 1029 | if err != nil { |
| 1030 | return err |
| 1031 | } |
| 1032 | if st.BackendState != state { |
| 1033 | return fmt.Errorf("in state %q; want %q", st.BackendState, state) |
| 1034 | } |
| 1035 | return nil |
| 1036 | }); err != nil { |
| 1037 | t.Fatalf("failure/timeout waiting for transition to Running status: %v", err) |
| 1038 | } |
| 1039 | } |
| 1040 | |
| 1041 | // AwaitNeedsLogin waits for n to reach the IPN state "NeedsLogin". |
| 1042 | func (n *TestNode) AwaitNeedsLogin() { |