File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -187,7 +187,28 @@ public void TestLoad()
187187 }
188188 }
189189
190-
190+ /// <summary>
191+ /// Test for issue #761. Because the nature of this test is a race condition,
192+ /// it is not guaranteed to fail if the issue is present. It does appear to
193+ /// fail most of the time, though.
194+ /// </summary>
195+ [ Test ]
196+ public void TestInsertCommandCreation ( )
197+ {
198+ using ( var dbConnection =
199+ new DbConnection ( SQLiteOpenFlags . FullMutex | SQLiteOpenFlags . ReadWrite | SQLiteOpenFlags . Create ) ) {
200+ var obj1 = new TestObj ( ) ;
201+ var obj2 = new TestObj ( ) ;
202+ var taskA = Task . Run ( ( ) => {
203+ dbConnection . Insert ( obj1 ) ;
204+ } ) ;
205+ var taskB = Task . Run ( ( ) => {
206+ dbConnection . Insert ( obj2 ) ;
207+ } ) ;
208+
209+ Task . WhenAll ( taskA , taskB ) . Wait ( ) ;
210+ }
211+ }
191212 }
192213}
193214
You can’t perform that action at this time.
0 commit comments