public bool StartTestGeneration()
        {
            _testsMaintainer.StartHost(_sequenceData);
            ISequenceManager sequenceManager = _globalInfo.TestflowRunner.SequenceManager;

            if (_sequenceData is ITestProject)
            {
                ITestProject testProject = _sequenceData as ITestProject;
                _testsMaintainer.SendRmtGenMessage(CoreConstants.TestProjectSessionId,
                                                   sequenceManager.RuntimeSerialize(testProject));
                foreach (ISequenceGroup sequenceGroup in testProject.SequenceGroups)
                {
                    _testsMaintainer.SendRmtGenMessage(ModuleUtils.GetSessionId(testProject, sequenceGroup),
                                                       sequenceManager.RuntimeSerialize(sequenceGroup));
                }
            }
            else
            {
                _testsMaintainer.SendRmtGenMessage(0, sequenceManager.RuntimeSerialize(_sequenceData as ISequenceGroup));
            }
            // 等待远程生成结束
            _blockHandle.Timeout = _globalInfo.ConfigData.GetProperty <int>("TestGenTimeout");
            bool isNotTimeout = _blockHandle.Wait(Constants.RmtGenState);

            if (!isNotTimeout)
            {
                _globalInfo.LogService.Print(LogLevel.Error, CommonConst.PlatformLogSession, "Test generation timeout.");
                _globalInfo.StateMachine.State = RuntimeState.Timeout;
                throw new TestflowRuntimeException(ModuleErrorCode.OperationTimeout,
                                                   _globalInfo.I18N.GetStr("TestGenTimeout"));
            }
            // 如果是异常状态则返回false
            return(_globalInfo.StateMachine.State < RuntimeState.Abort);
        }
        public void StartTestGeneration()
        {
            _testsMaintainer.StartHost();
            ISequenceManager sequenceManager = _globalInfo.TestflowRunner.SequenceManager;

            if (_sequenceData is ITestProject)
            {
                ITestProject testProject = _sequenceData as ITestProject;
                _testsMaintainer.SendTestGenMessage(CoreConstants.TestProjectSessionId,
                                                    sequenceManager.RuntimeSerialize(testProject));
                foreach (ISequenceGroup sequenceGroup in testProject.SequenceGroups)
                {
                    _testsMaintainer.SendTestGenMessage(ModuleUtils.GetSessionId(testProject, sequenceGroup),
                                                        sequenceManager.RuntimeSerialize(sequenceGroup));
                }
                // 初始化每个模块的监听变量
                foreach (int session in _testsMaintainer.TestContainers.Keys)
                {
                    _debugManager?.SendInitBreakPointMessage(session);
                }
            }
            else
            {
                _testsMaintainer.SendTestGenMessage(0, sequenceManager.RuntimeSerialize(_sequenceData as ISequenceGroup));
                _debugManager?.SendInitBreakPointMessage(0);
            }
            // 等待远程生成结束
            _blockHandle.Wait(Constants.RmtGenState);
        }