Skip to content

acc: show that direct engine ignores suspend_timeout_duration updates - #6375

Merged
denik merged 2 commits into
mainfrom
denik/time-diff
Aug 25, 2026
Merged

denik merged 2 commits into
mainfrom
denik/time-diff

Conversation

@denik

@denik denik commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Changes

Acceptance test that demonstrates an existing bug: editing a duration field is silently dropped by the direct engine.

Changing suspend_timeout_duration from 300s to 600s on a postgres endpoint plans 0 to change and leaves the endpoint at 300s. Terraform plans 1 to change and applies it.

Cause: structdiff compares duration.Duration field by field, and that type holds a single unexported protobuf pointer, so any two values look equal to it. Same for types/time.Time. Only nil <-> set transitions are detected.

The goldens encode the current (wrong) direct behaviour, so the fix will show up as a diff on out.plan.direct.txt / out.endpoint.direct.txt.

Prior art: #4480 implemented this fix but went stale and was auto-closed.

Tests

New acceptance test.

This pull request and its description were written by Isaac.

denik added 2 commits August 25, 2026 11:41
Changing suspend_timeout_duration from 300s to 600s plans "0 to change"
under the direct engine and the endpoint keeps its old value, while
terraform applies the update. structdiff compares duration.Duration field
by field and that type holds a single unexported protobuf pointer, so any
two values look equal to it.

Co-authored-by: Isaac
@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 7dccc1a

Run: 32834392791

Env 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
💚​ aws linux 1 4 277 1180 4:41
💚​ aws windows 1 4 279 1178 4:36
💚​ azure linux 1 4 273 1181 4:32
💚​ azure windows 1 4 275 1179 3:17
💚​ gcp linux 1 4 274 1181 4:48
💚​ gcp windows 1 4 276 1179 3:19
Test Name aws linux aws windows azure linux azure windows gcp linux gcp windows
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
🙈​ TestAccept/bundle/invariant/no_drift 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_endpoints/drift/recreated_same_name 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_indexes/recreate/embedding_dimension 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/ssh/connection 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
Top 3 slowest tests (at least 2 minutes):
duration env testname
3:29 aws windows TestAccept
3:13 azure windows TestAccept
3:12 gcp windows TestAccept

@denik
denik added this pull request to the merge queue Aug 25, 2026
Merged via the queue into main with commit 757a767 Aug 25, 2026
25 checks passed
@denik
denik deleted the denik/time-diff branch August 25, 2026 12:02
alex-khakhlyuk pushed a commit to alex-khakhlyuk/cli that referenced this pull request Aug 28, 2026
`duration.Duration` and `common/types/time.Time` keep their payload in
an unexported protobuf pointer, so structdiff saw any two values as
equal and `suspend_timeout_duration: 300s -> 600s` planned 0 to change.
Such structs are now recognized by shape — no fields for the walk to
see, plus a `json.Marshaler` of their own — and compared through their
JSON form, so there is no type list to maintain. `isEmptyStruct` had the
same blind spot, hence two goldens now showing `spec:input_only`.

Four resources have such fields in their config, and every field a user
can set now has a test:

- `secrets.expire_time` and
`postgres_projects.history_retention_duration` apply cleanly — the first
updates with `update_mask=*`, the second is masked under its own name.
- `postgres_branches.source_branch_time` is immutable, so a change
recreates the branch and never touches update_mask. Before this fix it
was invisible and the branch silently kept its old fork point.
- `postgres_endpoints.suspend_timeout_duration`,
`postgres_branches.ttl`, `postgres_branches.expire_time` and
`postgres_projects.default_endpoint_settings.suspend_timeout_duration`
are members of a oneof: the plan is right, but applying it fails because
the direct engine masks the field under its own name while the API only
accepts the group name (`spec.suspension`, `spec.expiration`). That is a
separate bug; the tests record the failure for the follow-up fix.

The testserver now validates update_mask against the paths the real API
accepts, so those failures reproduce locally rather than only on cloud,
and it no longer drops `expire_time` on branch create/update or the two
duration fields on project update — it was reporting changes that never
took effect.

Test added in databricks#6375.
janniklasrose pushed a commit that referenced this pull request Sep 15, 2026
…#6375)

## Changes

Acceptance test that demonstrates an existing bug: editing a duration
field is silently dropped by the direct engine.

Changing `suspend_timeout_duration` from `300s` to `600s` on a postgres
endpoint plans `0 to change` and leaves the endpoint at `300s`.
Terraform plans `1 to change` and applies it.

Cause: `structdiff` compares `duration.Duration` field by field, and
that type holds a single unexported protobuf pointer, so any two values
look equal to it. Same for `types/time.Time`. Only `nil` <-> set
transitions are detected.

The goldens encode the current (wrong) direct behaviour, so the fix will
show up as a diff on `out.plan.direct.txt` / `out.endpoint.direct.txt`.

Prior art: #4480 implemented this fix but went stale and was
auto-closed.

## Tests

New acceptance test.

This pull request and its description were written by Isaac.
janniklasrose pushed a commit that referenced this pull request Sep 15, 2026
`duration.Duration` and `common/types/time.Time` keep their payload in
an unexported protobuf pointer, so structdiff saw any two values as
equal and `suspend_timeout_duration: 300s -> 600s` planned 0 to change.
Such structs are now recognized by shape — no fields for the walk to
see, plus a `json.Marshaler` of their own — and compared through their
JSON form, so there is no type list to maintain. `isEmptyStruct` had the
same blind spot, hence two goldens now showing `spec:input_only`.

Four resources have such fields in their config, and every field a user
can set now has a test:

- `secrets.expire_time` and
`postgres_projects.history_retention_duration` apply cleanly — the first
updates with `update_mask=*`, the second is masked under its own name.
- `postgres_branches.source_branch_time` is immutable, so a change
recreates the branch and never touches update_mask. Before this fix it
was invisible and the branch silently kept its old fork point.
- `postgres_endpoints.suspend_timeout_duration`,
`postgres_branches.ttl`, `postgres_branches.expire_time` and
`postgres_projects.default_endpoint_settings.suspend_timeout_duration`
are members of a oneof: the plan is right, but applying it fails because
the direct engine masks the field under its own name while the API only
accepts the group name (`spec.suspension`, `spec.expiration`). That is a
separate bug; the tests record the failure for the follow-up fix.

The testserver now validates update_mask against the paths the real API
accepts, so those failures reproduce locally rather than only on cloud,
and it no longer drops `expire_time` on branch create/update or the two
duration fields on project update — it was reporting changes that never
took effect.

Test added in #6375.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants