Skip to content

Commit

Permalink
Merge pull request #3807 from Ginger-Automation/Beta/BugFix/RunnerFix
Browse files Browse the repository at this point in the history
Parallel Runner Issue Fixed
  • Loading branch information
Maheshkale447 authored Jul 3, 2024
2 parents c43b3b4 + b4a0089 commit 1931e4d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
24 changes: 11 additions & 13 deletions Ginger/GingerCoreNET/Run/GingerExecutionEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,6 @@ public void RunRunner(bool doContinueRun = false)
mErrorPostExecutionActionFlowBreaker = false;
}


}
}

Expand Down Expand Up @@ -830,20 +829,19 @@ private void SetupVirtualAgents()
}
/// <summary>
/// logic for if need to assign virtual agent
/// Second condition for If any runner have same agent multiple times then for that runner it will not launch multiple agent within same runner
/// third condition if any agent is used in different agent then only it will create virtual agent for that specific agent
/// Second condition if any agent is used in different agent then only it will create virtual agent for that specific agent
/// </summary>
if (agent.SupportVirtualAgent() && runSetConfig.ActiveAgentListWithRunner.Where(entry => entry.Key == mGingerRunner.Guid).Select(y => y.Value).Where(y => y != null).Any(x => (x.Any(k => ((Agent)k).Guid != agent.Guid))) && runSetConfig.ActiveAgentListWithRunner.Where(entry => entry.Key != mGingerRunner.Guid).Select(y => y.Value).Where(y => y != null).Any(x => (x.Any(k => ((Agent)k).Guid == agent.Guid || (((Agent)k).ParentGuid != null && ((Agent)k).ParentGuid == agent.Guid)))))
if (agent.SupportVirtualAgent() && runSetConfig.ActiveAgentListWithRunner.Where(entry => entry.Key != mGingerRunner.Guid).Select(y => y.Value).Where(y => y != null).Any(x => (x.Any(k => ((Agent)k).Guid == agent.Guid || (((Agent)k).ParentGuid != null && ((Agent)k).ParentGuid == agent.Guid)))))
{
var virtualagent = agent.CreateCopy(true) as Agent;
virtualagent.AgentOperations = new AgentOperations(virtualagent);
virtualagent.ParentGuid = agent.Guid;
virtualagent.Name = agent.Name + " Virtual";
virtualagent.IsVirtual = true;
virtualagent.DriverClass = agent.DriverClass;
virtualagent.DriverType = agent.DriverType;
applicationAgent.Agent = virtualagent;
virtualagent.DriverConfiguration = agent.DriverConfiguration;
var virtualagent = agent.CreateCopy(true) as Agent;
virtualagent.AgentOperations = new AgentOperations(virtualagent);
virtualagent.ParentGuid = agent.Guid;
virtualagent.Name = agent.Name + " Virtual";
virtualagent.IsVirtual = true;
virtualagent.DriverClass = agent.DriverClass;
virtualagent.DriverType = agent.DriverType;
applicationAgent.Agent = virtualagent;
virtualagent.DriverConfiguration = agent.DriverConfiguration;
}
}

Expand Down
2 changes: 1 addition & 1 deletion Ginger/GingerCoreNET/RunLib/AgentOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ public void WaitForAgentToBeReady()
Counter++;

int waitingTime = 30;// 30 seconds
if (Driver.DriverLoadWaitingTime > 0)
if (Driver != null && Driver.DriverLoadWaitingTime > 0)
{
waitingTime = Driver.DriverLoadWaitingTime;
}
Expand Down

0 comments on commit 1931e4d

Please sign in to comment.