Repository navigation
Conversation
roji
force-pushed
the
roji-fix-flaky-test
branch
from
June 28, 2026 14:35
a7d7dbc to
218e824
Compare
There was a problem hiding this comment.
Pull request overview
This PR aims to reduce CI wall-clock time by overlapping PostgreSQL setup with .NET build steps, and fixes a concurrency-related test flake by making generated temp table names unique across multiple testhost processes.
Changes:
- Added a centralized
GenerateTempTableName()helper that includes the current process ID to prevent temp table name collisions under concurrent test execution. - Updated transaction test helpers to use
GenerateTempTableName()instead of directly incrementing_tempTableCounter. - Modified the GitHub Actions build workflow to attempt running PostgreSQL setup “in parallel” with other setup/build steps and to run tests with
--no-build.
Show a summary per file
| File | Description |
|---|---|
| test/Npgsql.Tests/TestUtil.cs | Introduces GenerateTempTableName() using Environment.ProcessId + counter and switches temp table creation helpers to use it. |
| test/Npgsql.Tests/SystemTransactionTests.cs | Updates temp table helper to call GenerateTempTableName() and removes now-unused System.Threading import. |
| test/Npgsql.Tests/DistributedTransactionTests.cs | Updates temp table helper to call GenerateTempTableName() to avoid cross-process name collisions. |
| .github/workflows/build.yml | Reorders CI steps and introduces background: true / wait-all: true to attempt parallelizing PostgreSQL setup; switches test invocation to --no-build. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Low
roji
enabled auto-merge (squash)
July 8, 2026 08:47
vonzshik
reviewed
Jul 8, 2026
roji
force-pushed
the
roji-fix-flaky-test
branch
from
July 12, 2026 12:16
2d76ee2 to
f2435ca
Compare
roji
force-pushed
the
roji-fix-flaky-test
branch
from
July 12, 2026 12:28
f2435ca to
86408aa
Compare
roji
force-pushed
the
roji-fix-flaky-test
branch
from
July 12, 2026 12:34
86408aa to
b1b386d
Compare
There was a problem hiding this comment.
Review details
Comments suppressed due to low confidence (1)
test/Npgsql.Tests/Support/TestBase.cs:814
- Database creation uses string concatenation ("CREATE DATABASE " + conn.Database) without quoting/escaping the database identifier. This can fail for valid database names requiring quoting (e.g. mixed-case, dashes) and also allows SQL injection if the database name comes from an environment-provided connection string. Consider quoting the identifier the same way TestDatabase.EnsureTestDatabase does.
var builder = new NpgsqlConnectionStringBuilder(conn.ConnectionString)
{
Pooling = false,
Database = "postgres"
};
- Files reviewed: 13/13 changed files
- Comments generated: 0 new
- Review effort level: Low
Co-authored-by: Copilot App <[email protected]>
roji
force-pushed
the
roji-fix-flaky-test
branch
from
July 12, 2026 12:40
b1b386d to
c424881
Compare
Member
Author
|
Went with the alternate approach in #6621 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a flaky failure exposed when
dotnet testruns multiple test assemblies against the same PostgreSQL database concurrently. Each test project now runs against its own PG database.