fix(dbtest): comment accuracy + GET_LOCK/ctx deadline note (bookshelf-061u) #800
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "bd-bookshelf-061u"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Three review minors from PR #587 code review (comment 6925):
cloneSchemaFromTemplateschema_migrations error path: previously returnednilwith a misleading comment claiming "migrations will re-apply". This is wrong — the table DDL was already cloned by the loop above, so re-running migrations would fail with "table already exists". Now returns the error to surface the real problem.ensureTemplateDBGET_LOCK/ctx deadline: added a comment explaining that the 120s GET_LOCK MySQL timeout and the callerctxdeadline are independent; whichever fires first wins (effective cap =min(ctx deadline, 120s)).templateIsReadycomment accuracy: the error-swallow path says "absent or unreadable" but actually swallows all errors (network, context cancellation, absent table). Updated comment accurately describes the behaviour.Test plan
go build ./internal/dbtest/...compiles cleango build -tags integration ./internal/dbtest/...compiles cleanmake testpasses (unit suite, no DB required)NewSuiteDB+StartSharedMySQL(the paths that exercise the happy path through all three changed functions)Closes bead bookshelf-061u on merge.