chore: add database dump and dbfake logging (#19144)

relates to  #778

Somehow in `TestWorkspaceAgent` the agent with the test instance identifier is not being added to the database, or is getting deleted.

I'm adding some additional logging to `dbfake` and setting the affected tests to dump postgres on error, to see if we can get to the bottom of the issue.
This commit is contained in:
Spike Curtis
2025-08-04 13:22:04 +04:00
committed by GitHub
parent e80f91e900
commit d4b44185da
4 changed files with 86 additions and 10 deletions
+1 -1
View File
@@ -206,7 +206,7 @@ func DumpOnFailure(t testing.TB, connectionURL string) {
outPath := filepath.Join(cwd, snakeCaseName+"."+timeSuffix+".test.sql")
dump, err := PGDump(connectionURL)
if err != nil {
t.Errorf("dump on failure: failed to run pg_dump")
t.Errorf("dump on failure: failed to run pg_dump: %s", err.Error())
return
}
if err := os.WriteFile(outPath, normalizeDump(dump), 0o600); err != nil {