Runner session error "Another session is already executing"

Hello all,

I’ve a problem where I need your help. I’ve started a runner with 2 sessions and I’m starting a test plan run in each session. The first one starts without issues the second one throws an exception with the message “Another session is already executing”. I can’t see the reason for it. Here is my code:

string url = tbNatsUrl.Text.Trim();
var connection = new NatsConnection(new NatsOpts { Url = url });
await connection.ConnectAsync();
_natsConnection = connection;
string tapPlanXml1 = await File.ReadAllTextAsync(@"D:\TestPlans\Test1.TapPlan");
string tapPlanXml2 = await File.ReadAllTextAsync(@"D:\TestPlans\Test2.TapPlan");

var runner = new RunnerClient(_natsConnection);

// Zwei *separate* Runner-Sessions (jeweils eigener Prozess)
var session1 = await runner.StartSessionAsync();
var session2 = await runner.StartSessionAsync();

await session1.SetTestPlanXMLAsync(tapPlanXml1);
await session2.SetTestPlanXMLAsync(tapPlanXml2);

try
{

    await session1.RunTestPlanAsync([]);
    await session2.RunTestPlanAsync([]);

}
catch (Exception ex)
{
    Log($"Fehler beim Starten der Testpläne: {ex.Message}");
    MessageBox.Show(ex.Message);
}

}

As an additional information, I’m working in the same company as the guy with this post:

and I had the same problem, which was solved with an update of the runner. I think it could be a simillar problem because I’m not alone in my company with that error. But a colleague who works at a subsidiary has no problems with the same code. We are using all the actual versions of the OpenTap software. For the Runner I’m using the version 2.4.0-beta.2. I have to use a beta because of the bug in the mentioned post.

Is there any more detail if you start the runner in verbose mode?
tap runner start -v

MyRunnerLog.txt (15.3 KB)

As you can see the session state of the second session never changes from Idle to Executing.

Hello frank,

this error usually occurs if in your Runner Settings you have “Allow Parallel Runs” set to false. Then you can’t run testplans on two sessions at the same time. Switch this to true, either over the Editor or in the Runner Settings xml itself, restart the runner, and then it should work.