/// <exception cref="System.Exception"/> public static void WaitForElectorState(MultithreadedTestUtil.TestContext ctx, ActiveStandbyElector elector, ActiveStandbyElector.State state) { while (elector.GetStateForTests() != state) { if (ctx != null) { ctx.CheckException(); } Thread.Sleep(50); } }
/// <summary>Wait for the given elector to enter the given elector state.</summary> /// <param name="idx">the service index (0 or 1)</param> /// <param name="state">the state to wait for</param> /// <exception cref="System.Exception"> /// if it times out, or an exception occurs on one /// of the ZKFC threads while waiting. /// </exception> public virtual void WaitForElectorState(int idx, ActiveStandbyElector.State state ) { ActiveStandbyElectorTestUtil.WaitForElectorState(ctx, GetElector(idx), state); }