Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions test/Microsoft.Data.Sqlite.Tests/SqliteCommandTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ public void ExecuteReader_supports_CloseConnection()
}
}

[Theory]
[Theory(Skip = "#35585")]
[InlineData(true)]
[InlineData(false)]
public Task ExecuteReader_retries_when_locked(bool extendedErrorCode)
Expand Down Expand Up @@ -916,7 +916,7 @@ public Task ExecuteReader_retries_when_locked(bool extendedErrorCode)
}));
}

[Fact]
[Fact(Skip = "#35585")]
public async Task ExecuteReader_retries_when_busy()
{
const string connectionString = "Data Source=busy.db";
Expand Down Expand Up @@ -968,29 +968,29 @@ await Task.WhenAll(
}
}

[Fact]
[Fact(Skip = "#35585")]
public Task ExecuteScalar_throws_when_busy_with_returning()
=> Execute_throws_when_busy_with_returning(
command =>
{
var ex = Assert.Throws<SqliteException>(
() => command.ExecuteScalar());

Assert.Equal(SQLITE_BUSY, ex.SqliteErrorCode);
AssertBusy(ex.SqliteErrorCode);
});

[Fact]
[Fact(Skip = "#35585")]
public Task ExecuteNonQuery_throws_when_busy_with_returning()
=> Execute_throws_when_busy_with_returning(
command =>
{
var ex = Assert.Throws<SqliteException>(
() => command.ExecuteNonQuery());

Assert.Equal(SQLITE_BUSY, ex.SqliteErrorCode);
AssertBusy(ex.SqliteErrorCode);
});

[Fact]
[Fact(Skip = "#35585")]
public Task ExecuteReader_throws_when_busy_with_returning()
=> Execute_throws_when_busy_with_returning(
command =>
Expand All @@ -1006,11 +1006,11 @@ public Task ExecuteReader_throws_when_busy_with_returning()
var ex = Assert.Throws<SqliteException>(
() => reader.Dispose());

Assert.Equal(SQLITE_BUSY, ex.SqliteErrorCode);
AssertBusy(ex.SqliteErrorCode);
}
});

[Fact]
[Fact(Skip = "#35585")]
public Task ExecuteReader_throws_when_busy_with_returning_while_draining()
=> Execute_throws_when_busy_with_returning(
command =>
Expand All @@ -1024,9 +1024,12 @@ public Task ExecuteReader_throws_when_busy_with_returning_while_draining()
var ex = Assert.Throws<SqliteException>(
() => reader.Read());

Assert.Equal(SQLITE_BUSY, ex.SqliteErrorCode);
AssertBusy(ex.SqliteErrorCode);
});

private static void AssertBusy(int rc)
=> Assert.True(rc is SQLITE_LOCKED or SQLITE_BUSY or SQLITE_LOCKED_SHAREDCACHE);

private static async Task Execute_throws_when_busy_with_returning(Action<SqliteCommand> action)
{
const string connectionString = "Data Source=returning.db";
Expand Down