Conversation
|
@claude Fix Go linting issues |
|
Claude finished @pfcoperez's task in 7m 22s —— View job Fixing Go Linting Issues
All fixes are committed locally (commit Changes made:
Full diffdiff --git a/flow/internal/testutil/env.go b/flow/internal/testutil/env.go
--- a/flow/internal/testutil/env.go
+++ b/flow/internal/testutil/env.go
@@ -1,6 +1,7 @@
package testutil
import (
+ "context"
"log/slog"
"os"
"path/filepath"
@@ -13,11 +14,11 @@ func LoadEnv() {
dir, err := os.Getwd()
if err != nil {
- slog.Error("LoadEnv: failed to get working directory", "error", err)
+ slog.ErrorContext(context.Background(), "LoadEnv: failed to get working directory", "error", err)
return
}
- slog.Info("LoadEnv: starting search", "cwd", dir)
+ slog.InfoContext(context.Background(), "LoadEnv: starting search", "cwd", dir)
...
if _, err := os.Stat(envPath); err == nil && filepath.Base(lastVisited) == "flow" {
- slog.Info("LoadEnv: found .env", "path", envPath)
- godotenv.Load(envPath)
+ slog.InfoContext(context.Background(), "LoadEnv: found .env", "path", envPath)
+ if err := godotenv.Load(envPath); err != nil {
+ slog.WarnContext(context.Background(), "LoadEnv: failed to load .env", "error", err)
+ }
return
}
- slog.Warn("LoadEnv: no .env file found above flow directory")
+ slog.WarnContext(context.Background(), "LoadEnv: no .env file found above flow directory")
diff --git a/flow/internal/testutil/env_test.go b/flow/internal/testutil/env_test.go
// In each of the 6 test functions, replace:
- originalDir, err := os.Getwd()
- require.NoError(t, err)
- t.Cleanup(func() { os.Chdir(originalDir) })
- require.NoError(t, os.Chdir(xDir))
+ t.Chdir(xDir)
// And change os.WriteFile permissions:
- os.WriteFile(envFile, ..., 0o644)
+ os.WriteFile(envFile, ..., 0o600) |
❌ 2 Tests Failed:
View the top 2 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
🔄 Flaky Test DetectedAnalysis: Two e2e tests failed due to concurrency/timing issues: one hit a PostgreSQL SQLSTATE 57P01 (connection killed by admin command, likely from a parallel test's cancellation logic), and the other hit a ClickHouse "unknown table" error because the QRep initial load hadn't completed before the assertion fired — both are race conditions in the highly parallel (-p 32) test suite, not code regressions. ✅ Automatically retrying the workflow |
🔄 Flaky Test DetectedAnalysis: All three failures are infrastructure/timing issues: one Temporal client connection timeout ("context deadline exceeded") and two BigQuery normalization timeouts ("UNEXPECTED TIMEOUT normalizing N rows"), consistent with CI resource contention under 32-parallel-test load rather than a code regression. ✅ Automatically retrying the workflow |
🔄 Flaky Test DetectedAnalysis: Both failures show race conditions in e2e tests — ClickHouse returning "unknown table identifier" and PostgreSQL returning "column does not exist" on destination tables indicate schema changes/table creation hadn't propagated before the test polled for results. ✅ Automatically retrying the workflow |
🔄 Flaky Test DetectedAnalysis: TestApiPg/TestFlowStatusUpdate failed with PostgreSQL SQLSTATE 57P01 ("terminating connection due to administrator command"), a transient infrastructure-level connection kill unrelated to test logic. ✅ Automatically retrying the workflow |
🔄 Flaky Test DetectedAnalysis: Test_Soft_Delete_Basic timed out after 200s waiting for BigQuery normalization to replicate a soft-deleted row (source had 1 record, destination consistently showed 0), indicating a transient CDC synchronization delay rather than a code regression. ✅ Automatically retrying the workflow |
… to find `.env` only under the root project
…other parameters to tests.
… default with e2e execution and adds a "start all test services" button
…e superfluous dependencies for connectors tests from connectors test launchers.
…actoring out overrides in common Tilt constants
…least one test execution regardless of the cache state.
…lt's label alphabetical order
cea4dcc to
a32e948
Compare
❌ Test FailureAnalysis: Two newly introduced unit tests ( |
|
@claude Fix linting issues |
|
Claude finished @pfcoperez's task in 4m 36s —— View job Fixing Go Linting Issues & Failing Tests
Root cause of the failing tests: Fix ( Note: the linting fixes (context-aware slog calls, |
❌ Test FailureAnalysis: Two unit tests in |
loadedEnv is a package-level atomic.Bool that acts as a once-guard. Tests run in the same process, so the first test to call LoadEnv() sets it true, making all subsequent LoadEnv() calls no-ops. This caused TestLoadEnv_FromConnectorsSubdir and TestLoadEnv_RunFromFlowDirectly to always see empty strings instead of their expected env var values. Reset the flag before each test's LoadEnv() call to ensure proper per-test isolation.
dff3805 to
3fe8ae6
Compare
🔄 Flaky Test DetectedAnalysis: TestApiPg/TestQRep failed because the ClickHouse destination table was never created within the wait window (63s), likely due to resource contention from 32 parallel tests starving the async Temporal QRep workflow — the triggering commit only touched postgres-to-postgres MERGE logic and is unrelated to ClickHouse QRep. ✅ Automatically retrying the workflow |
🔄 Flaky Test DetectedAnalysis: TestGenericBQ/Test_Inheritance_Table_With_Dynamic_Setting timed out (after 196s) waiting for BigQuery row propagation from inherited Postgres tables — a classic e2e timing failure under heavy parallelism (-p 32), not a logic regression. ✅ Automatically retrying the workflow |
🔄 Flaky Test DetectedAnalysis: The tests fail during teardown with PostgreSQL SQLSTATE 57P01 ("terminating connection due to administrator command"), indicating the catalog DB connection was externally killed mid-cleanup — different tests fail across matrix runs, confirming an infrastructure-level flake rather than a code regression. ✅ Automatically retrying the workflow |
🔄 Flaky Test DetectedAnalysis: Both failing jobs hit SQLSTATE 57P01 (PostgreSQL admin_shutdown) during a catalog connection, indicating the CI catalog database was externally terminated mid-test — a transient infrastructure failure, not a code bug. ✅ Automatically retrying the workflow |
🔄 Possible Flaky TestAnalysis: The CI run was still in progress when logs were requested, preventing analysis of the failure; low confidence assessment as flaky due to inability to retrieve logs. |
Co-authored-by: Ilia Demianenko <ilia.demianenko@clickhouse.com>
|
@claude Replace the atomic loadedEnv that makes LoadEnv logic to run once by sync.Once . Take into account that you'll need to reset it in the unit tests for this function at flow/internal/testutil/env_test.go |
|
Claude finished @pfcoperez's task in 1m 14s —— View job Replacing
|
Use the idiomatic sync.Once pattern instead of atomic.Bool for the
LoadEnv once-guard. Tests reset the guard with `loadedEnv = sync.Once{}`
(same-package access) for test isolation.
Co-authored-by: Pablo Francisco Pérez Hidalgo <pfcoperez@users.noreply.github.com>
…nv/e2e/automatic-envvars-injection
🔄 Flaky Test DetectedAnalysis: The test failed with a transient PostgreSQL catalog connection error (SQLSTATE 57P01 — "terminating connection due to administrator command"), indicating the DB connection was killed mid-test by a concurrent operation rather than a code regression. ✅ Automatically retrying the workflow |
🔄 Flaky Test DetectedAnalysis: All three TestGenericBQ failures are STATUS_SNAPSHOT timeouts in a high-concurrency (p=32) mysql-gtid run — a known flaky scenario explicitly acknowledged in the codebase, with no code changes in this commit related to BigQuery snapshot behavior. ✅ Automatically retrying the workflow |
This Pull Requests adds two main features to local development environment and tests:
flow/connectorsandflow/e2etests read all required environment variables from.envfile at the project root directory. Remember that.envcan be set-up using.env.examplefile. This removes the frictions across different dev OSs and make it possible to start debugging sessions without editing launching scripts or vscode tempaltesCloses: https://linear.app/clickhouse/issue/DBI-640/make-e2e-and-integration-tests-pass-in-peerdb-tilt