Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: stop running postgres-only tests if DB is not set#18784

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Show file tree
Hide file tree
Changes fromall 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
4 changes: 4 additions & 0 deletionscoderd/database/db_test.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -85,6 +85,10 @@ func TestNestedInTx(t *testing.T) {
func testSQLDB(t testing.TB) *sql.DB {
t.Helper()

if !dbtestutil.WillUsePostgres() {
t.Skip("this test requires postgres")
}

connection, err := dbtestutil.Open(t)
require.NoError(t, err)

Expand Down
4 changes: 2 additions & 2 deletionscoderd/database/dbtestutil/postgres.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -81,7 +81,7 @@ func initDefaultConnection(t TBSubset) error {
}

var dbErr error
// Retry up to3 seconds for temporary errors.
// Retry up to10 seconds for temporary errors.
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
for r := retry.New(10*time.Millisecond, 500*time.Millisecond); r.Wait(ctx); {
Expand All@@ -93,7 +93,7 @@ func initDefaultConnection(t TBSubset) error {
if !containsAnySubstring(errString, retryableErrSubstrings) {
break
}
t.Logf("failed to connect to postgres, retrying: %s", errString)
t.Logf("%sfailed to connect to postgres, retrying: %s", time.Now().Format(time.StampMilli), errString)
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

added this because it looks like we only retried 3 times, even though we're supposed to wait 10 seconds. Timestamp information will be helpful if we hit it again.

}

// After the loop dbErr is the last connection error (if any).
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp