Commit 409edc0a authored by Marc Gravell's avatar Marc Gravell

ScriptThrowsErrorInsideTransaction: subtle difference between "completed now"...

ScriptThrowsErrorInsideTransaction: subtle difference between "completed now" and "becomes completed momentarily"
parent 61e81d04
...@@ -308,8 +308,8 @@ public void ScriptThrowsErrorInsideTransaction() ...@@ -308,8 +308,8 @@ public void ScriptThrowsErrorInsideTransaction()
var complete = tran.ExecuteAsync(); var complete = tran.ExecuteAsync();
Assert.True(muxer.Wait(complete)); Assert.True(muxer.Wait(complete));
Assert.True(a.IsCompleted, a.Status.ToString()); Assert.True(QuickWait(a).IsCompleted, a.Status.ToString());
Assert.True(c.IsCompleted, "State: " + c.Status); Assert.True(QuickWait(c).IsCompleted, "State: " + c.Status);
Assert.Equal(1L, a.Result); Assert.Equal(1L, a.Result);
Assert.Equal(2L, c.Result); Assert.Equal(2L, c.Result);
...@@ -323,6 +323,14 @@ public void ScriptThrowsErrorInsideTransaction() ...@@ -323,6 +323,14 @@ public void ScriptThrowsErrorInsideTransaction()
Assert.Equal(2L, (long)conn.Wait(afterTran)); Assert.Equal(2L, (long)conn.Wait(afterTran));
} }
} }
private static Task<T> QuickWait<T>(Task<T> task)
{
if (!task.IsCompleted)
{
try { task.Wait(200); } catch { }
}
return task;
}
[Fact] [Fact]
public async Task ChangeDbInScript() public async Task ChangeDbInScript()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment