Skip to content

Commit

Permalink
Skip flaky SqliteCommandTest tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AndriySvyryd committed Feb 4, 2025
1 parent 53f8ffd commit 173cae4
Showing 1 changed file with 13 additions and 10 deletions.
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

0 comments on commit 173cae4

Please sign in to comment.