-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #2488 LockRecursionException when doing FindById
- Loading branch information
Showing
2 changed files
with
68 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using FluentAssertions; | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
using Xunit; | ||
|
||
namespace LiteDB.Tests.Issues; | ||
|
||
public class Issue2471_Test | ||
{ | ||
[Fact] | ||
public void TestFragmentDB_FindByIDException() | ||
{ | ||
using var db = new LiteDatabase(":memory:"); | ||
var collection = db.GetCollection<object>("fragtest"); | ||
|
||
var fragment = new object { }; | ||
var id = collection.Insert(fragment); | ||
|
||
id.Should().BeGreaterThan(0); | ||
|
||
var frag2 = collection.FindById(id); | ||
frag2.Should().NotBeNull(); | ||
|
||
Action act = () => db.Checkpoint(); | ||
|
||
//act.Should().Throw<LockRecursionException>(); | ||
act.Should().NotThrow(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters