Skip to content

Commit

Permalink
add extra debugging info into test
Browse files Browse the repository at this point in the history
  • Loading branch information
tofutim authored and oysteinkrog committed Nov 14, 2015
1 parent b6af096 commit 715ac57
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/AsyncTests.cs
Expand Up @@ -162,15 +162,21 @@ public async Task GetAsync()
Assert.AreEqual(customer.Id, loaded.Id);
}


[Test]
public async Task StressAsync()
{
const int defaultBusyTimeout = 100;

SQLiteAsyncConnection globalConn = GetAsyncConnection();

// see http://stackoverflow.com/questions/12004426/sqlite-returns-sqlite-busy-in-wal-mode
var journalMode = await globalConn.ExecuteScalarAsync<string>("PRAGMA journal_mode = wal"); // = wal");
Debug.WriteLine("journal_mode: " + journalMode);
var synchronous = await globalConn.ExecuteScalarAsync<string>("PRAGMA synchronous"); // 2 = FULL
Debug.WriteLine("synchronous: " + synchronous);
var pageSize = await globalConn.ExecuteScalarAsync<string>("PRAGMA page_size"); // 1024 default
Debug.WriteLine("page_size: " + pageSize);
var busyTimeout = await globalConn.ExecuteScalarAsync<string>(
string.Format("PRAGMA busy_timeout = {0}", defaultBusyTimeout));
Debug.WriteLine("busy_timeout: " + busyTimeout);
Expand All @@ -188,7 +194,7 @@ public async Task StressAsync()
{
SQLiteAsyncConnection conn = GetAsyncConnection();

// Each connection retains the global journal_mode but somehow resets busy_timeout to 100
// each connection retains the global journal_mode but somehow resets busy_timeout to 100
busyTimeout = await globalConn.ExecuteScalarAsync<string>(
string.Format("PRAGMA busy_timeout = {0}", defaultBusyTimeout));
// Debug.WriteLine("busy_timeout: " + busyTimeout);
Expand Down

0 comments on commit 715ac57

Please sign in to comment.