Skip to content

Commit cf3ce7f

Browse files
committed
Test stability improvement
1 parent af5f06a commit cf3ce7f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Orm/Xtensive.Orm.Tests/Issues/IssueGitHub0110_SimpleCommandProcessorOverridesOriginalException.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2020 Xtensive LLC.
1+
// Copyright (C) 2021 Xtensive LLC.
22
// This code is distributed under MIT license terms.
33
// See the License.txt file in the project root for more information.
44

@@ -133,12 +133,12 @@ public void MainTest()
133133
var task1State = new OperationState(Domain);
134134
var task2State = new OperationState(Domain);
135135

136-
var task1 = new System.Threading.Tasks.Task(Outer, task1State);
137-
var task2 = new System.Threading.Tasks.Task(Outer, task2State);
136+
var task1 = new Task(Outer, task1State);
137+
var task2 = new Task(Outer, task2State);
138138
task1.Start();
139139
task2.Start();
140140

141-
Thread.Sleep(500);
141+
Thread.Sleep(700);
142142

143143
_ = theStarter.Set();
144144

@@ -155,7 +155,6 @@ private static void Outer(object state)
155155
{
156156
var operationState = (OperationState) state;
157157

158-
_ = theStarter.WaitOne();
159158
try {
160159
using (var session = operationState.Domain.OpenSession(SessionType.User))
161160
using (var tx = session.OpenTransaction()) {
@@ -177,6 +176,7 @@ private static void Inner(Session session, Bin bin)
177176
using (var tx = session.OpenTransaction()) {
178177
var doc = session.Query.All<InventoryBalance>().SingleOrDefault(o => o.Active == true && o.Bin == bin);
179178
doc.N += 1;
179+
_ = theStarter.WaitOne();
180180
tx.Complete();
181181
}
182182
}

0 commit comments

Comments
 (0)