Skip to content

Commit 378c4a9

Browse files
committed
Fixed issue with dispose method on db event resolver
1 parent a890989 commit 378c4a9

15 files changed

Lines changed: 740 additions & 224 deletions

src/EventLogExpert.Eventing.Tests/EventProviderDatabase/EventProviderDbContextTests.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,9 @@ public void ProviderDetails_ShouldCompressLargeData()
262262
Tasks = new Dictionary<int, string>()
263263
};
264264

265+
// Calculate uncompressed data size: 100 messages * 1000 chars = ~100KB of text data
266+
const int UncompressedDataSize = 100 * 1000;
267+
265268
// Act
266269
using (var context = new EventProviderDbContext(dbPath, false))
267270
{
@@ -271,7 +274,12 @@ public void ProviderDetails_ShouldCompressLargeData()
271274

272275
// Assert
273276
var fileSize = new FileInfo(dbPath).Length;
274-
Assert.True(fileSize < 100000);
277+
278+
// Compression should result in file size significantly smaller than uncompressed data
279+
// Allow for SQLite overhead but verify compression achieved at least 2x reduction
280+
Assert.True(fileSize < UncompressedDataSize / 2,
281+
$"Expected compressed file size to be less than {UncompressedDataSize / 2} bytes, but was {fileSize} bytes. " +
282+
$"This suggests compression may not be working effectively.");
275283

276284
using (var context = new EventProviderDbContext(dbPath, true))
277285
{

0 commit comments

Comments
 (0)