private void VerifyCommandFailed(TestEvents ev, TimeSpan timeout, params string[] commands) { List <string> expected = new List <string>(); expected.Add("Request[Type:Create, Path:/$metadata/scheduler/commands]"); expected.Add("Request[Type:Create, Path:/$metadata/scheduler/failures]"); expected.Add("Request[Type:Create, Path:/$metadata/scheduler/inflight]"); expected.Add("Request[Type:GetChildren, Path:/$metadata/scheduler/commands]"); foreach (string command in commands) { expected.Add("<contains>Request[Type:Create, Path:/$metadata/scheduler/commands/" + command + "]"); } expected.Add("WatchedEvent[Class:WatchedEvent,Path=/$metadata/scheduler/commands,EventType=NodeChildrenChanged,KeeperState=SyncConnected]"); expected.Add("Request[Type:GetChildren, Path:/$metadata/scheduler/commands]"); foreach (string command in commands) { expected.Add("Request[Type:GetData, Path:/$metadata/scheduler/commands/" + command + "]"); expected.Add("Request[Type:Multi, Requests:Request[Type:Create, Path:/$metadata/scheduler/failures/" + command + "];Request[Type:Move, Path:/$metadata/scheduler/commands/" + command + ", PathDst:/$metadata/scheduler/failures/" + command + "];Request[Type:Create, Path:/$metadata/scheduler/failures/" + command + "/ResultData]]"); } string[] expectedArray = expected.ToArray(); ev.AssertOccursInOrder( "Timeout (10s) waiting for scheduler to close command as failed", false, TimeSpan.FromSeconds(10), expectedArray); }
private void VerifyCreated(TestEvents ev, TimeSpan timeout, string path) { ev.AssertOccursInOrder( "Timeout (10s) waiting for path to be created", false, TimeSpan.FromSeconds(10), "<contains>Request[Type:Create, Path:" + path + "]"); }
private void VerifySetup(TestEvents ev, TimeSpan timeout) { ev.AssertOccursInOrder( "Timeout (10s) waiting for scheduler to learn about baseline commands", false, TimeSpan.FromSeconds(10), "Request[Type:Create, Path:/$metadata/scheduler/commands]", "Request[Type:Create, Path:/$metadata/scheduler/failures]", "Request[Type:GetChildren, Path:/$metadata/scheduler/commands]"); }
private void VerifyCommandTaken(TestEvents ev, TimeSpan timeout, string command) { ev.AssertOccursInOrder( "Timeout (10s) waiting for scheduler to collect data for the new command", false, timeout, "Request[Type:Create, Path:/$metadata/scheduler/commands]", "Request[Type:Create, Path:/$metadata/scheduler/failures]", "Request[Type:Create, Path:/$metadata/scheduler/inflight]", "Request[Type:GetChildren, Path:/$metadata/scheduler/commands]", "<contains>Request[Type:Create, Path:/$metadata/scheduler/commands/" + command + "]", "WatchedEvent[Class:WatchedEvent,Path=/$metadata/scheduler/commands,EventType=NodeChildrenChanged,KeeperState=SyncConnected]", "Request[Type:GetChildren, Path:/$metadata/scheduler/commands]", "Request[Type:GetData, Path:/$metadata/scheduler/commands/" + command + "]", "<contains>Request[Type:Move, Path:/$metadata/scheduler/commands/" + command + ", PathDst:/$metadata/scheduler/"); }