Skip to content

Fixes 31735: stop Playwright support classes swallowing failed API responses - #31736

Merged
ShaileshParmar11 merged 18 commits into
mainfrom
fix/playwright-guard-api-responses
Aug 20, 2026
Merged

ShaileshParmar11 merged 18 commits into
mainfrom
fix/playwright-guard-api-responses

Conversation

@ShaileshParmar11

@ShaileshParmar11 ShaileshParmar11 commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #31735

Support classes assigned await response.json() onto responseData without checking the response, so on a non-2xx the error body became the entity's state — id and fullyQualifiedName gone, nothing thrown, and the run broke much later somewhere unrelated. Traces from four EKS nightly runs show a failed PATCH surfacing as a 30s waitForResponse timeout several steps downstream.

Four changes, smallest blast radius first:

  1. okJson — throws with status + body instead of returning an error payload. Applied to the 94 create/patch reads that were unguarded. Cleanup deletes are deliberately left tolerant, since a 404 there means "already gone".

  2. createOrFetch — treats 409 as success and fetches the existing entity. Extended from the collections observed failing to all ten *ServiceClass files plus Topic, Chart, MlModel, SearchIndex, Metric — 27 of 47 creating classes.

  3. Adoption requests relationship fields. The API answers null for anything not asked for, so a bare lookup reported domains: null on an entity that already had one, and the caller's own add /domains/0 was then rejected with RULE_VIOLATION: Multiple Domains are not allowed.

  4. Domain assignment is idempotent. op: 'add', path: '/domains/0' appends; path: '/domains' with an array sets. 56 sites converted. domainIsolationUtils.ts already used this form.

  5. Bounded 404 retry. createOrFetch retries a create whose dependency the server cannot see yet, and withNotFoundRetry wraps all 41 apiContext.patch sites in the support classes. A 404 means the request was rejected outright, so nothing was partially applied and re-sending is safe. Three attempts at 300/600/900ms; a genuinely wrong reference still fails, ~1.8s later.

FQN quoting is structural, not per-call-site. buildFqn(...segments) quotes each raw name and joins, and createOrFetch takes fqnSegments: string[], so no call site knows the escaping rules and a future fixture name containing a separator cannot silently break the lookup. quoteFqnSegment mirrors FullyQualifiedName.quoteName exactly — including escaping an embedded quote by doubling it, not backslashing it.

Type of change:

  • Bug fix

High-level design:

Two helpers in playwright/utils/apiResponse.ts that every creating class routes through, rather than 141 one-off guards. okJson is the failure boundary; createOrFetch is the 409 boundary; buildFqn/quoteFqnSegment own FQN escaping.

Scope was held deliberately: 25 classes stay on raw POST because their lookup is not a plain name-addressed create (BundleTestSuite deploy/trigger, Task, UserClass's /users/signup, Alert, KnowledgeCenter, LearningResource) or the FQN composition is intricate (the multi-child builders). None of them 409ed in the 113 traces, and a wrong FQN is worse than the status quo — it turns a recoverable 409 into a hard error. They are all still covered by okJson, so any future 409 there fails loudly with the collection and status named.

Tests:

Use cases covered

  • Two workers racing to create the same fixture: the loser adopts the existing entity instead of failing.
  • An adopted entity reports the domain it already has, so the caller does not re-add it.
  • Assigning a domain lands identically whether the entity was just created or adopted.
  • Any other non-2xx fails at the call that broke, naming status and body.
  • A fixture name containing an FQN separator survives adoption at full FQN depth.

Unit tests

Not applicable — Playwright harness code, not product code.

Backend integration tests

  • Not applicable (no backend changes).

Ingestion integration tests

  • Not applicable.

Playwright (UI) tests

No new specs. This changes shared fixture infrastructure used by the existing suite; the affected specs (PlatformLineage, NotificationTemplate, TestSuite, LineageFilters) already exist and are the ones flaking.

AUT (nightly topology) run

This change targets a failure mode that only appears when many Playwright processes share one
server, which PR CI cannot reproduce — every PR machine gets its own backend. It was therefore
validated on the nightly kind topology (8 shards x 3 workers against a single Collate backend),
run against both databases:

https://github.com/open-metadata/openmetadata-nightly/actions/runs/32354810496

mysql postgresql
Passed 7,680 7,683
Failed 1 1
Flaky 25 22
Duration 57 min 56 min

Against the pre-change nightly profile of 19-37 flaky / 1-6 hard failures, and against the
first guarded run on this topology (4 failed / 21 flaky), hard failures are down to one on each
database
— and that one is a known webhook-infrastructure issue tracked separately, unrelated to
this PR.

Every flake this change set out to fix is gone from both lanes:

Previously failing Status
PlatformLineage (10/13 on 2.0) absent
NotificationTemplate (9/13 on 2.0, 10/12 on 1.13) absent
TestSuite > Logical TestSuite absent
Pagination > Roles absent

One guard-attributable flake remains on each lane — ApiServiceClass.patch failed (404), which
passes on retry. It survives a 1.8s bounded retry, so the cause is most likely a concurrent
teardown hard-deleting the service (fixture isolation) rather than write visibility. Everything
else in the flaky lists is UI-timeout shaped with no API-layer involvement.

Latent bugs this surfaced. okJson makes previously swallowed errors throw, so it exposes
pre-existing bugs as well as fixing them. Each was fixed in this branch:

  • Pagination's Roles fixture passed policy.responseData.id where createRole.policies is typed
    entityName, so the server resolved a UUID by name and 404ed — deterministically, on every
    attempt. Every other RolesClass.create call site already passed .name.
  • hasDomain('...') passed an argument to a no-arg rule function.
  • SubDomain sent an unquoted dotted parent FQN.
  • Observability alerts defaulted to a resources value the server rejects.

Failures of that shape are newly visible, not newly broken.

Fixture hygiene. Seven Pagination describe blocks seeded entities and never removed them —
metrics, notification alerts, observability alerts, roles, policies, bots, and the tasks pipeline.
Every block that did clean up was deleting a parent service and relying on the cascade, so the
top-level types (which have no parent) leaked ~120 rows per run into the list endpoints other specs
read. All 21 blocks now tear down what they create.

Manual testing performed

Ran the modified support classes against a live 2.0.0-SNAPSHOT server — 7/7:

✓ DatabaseServiceClass.create adopts on 409
✓ TopicClass.create adopts service and topic on 409
✓ MessagingServiceClass.create adopts on 409
✓ PolicyClass and RolesClass adopt on 409 and keep a usable id
✓ Domain.create adopts on 409
✓ okJson throws with status and body
✓ dotted names survive adoption at every FQN depth

Separately confirmed the API semantics the change relies on (13/13): duplicate create → 409; name lookup resolves incl. nested service.database; a bare lookup hides an assigned domain while ?fields=domains,owners,tags reveals it; /domains/0 reproduces the 400 rule violation; /domains + array succeeds and is idempotent; and quoteFqnSegment('has"quote') → "has""quote".

Two bugs were found only by executing this — Domain.create failed outright on its dotted name, and the quote escaping was backslash rather than doubled. Neither was visible to any static check.

Gates: tsc -p playwright/tsconfig.json is 163 errors before and after (zero introduced, zero removed vs origin/main); eslint 0 errors; the CI lint sequence is idempotent; every delete() in the touched entity classes is byte-identical to main.

Not covered locally: whether any existing test currently passes because an error is swallowed. That needs the full suite, which is what CI here will exercise.

UI screen recording / screenshots:

Not applicable — no UI changes.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: not applicable.
  • For UI changes: not applicable.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.

Greptile Summary

The PR improves Playwright fixture reliability by validating API responses immediately and recovering from concurrent entity-creation conflicts.

  • Adds shared response validation, retry, conflict-adoption, and FQN-quoting utilities.
  • Routes fixture create and patch operations through the new response boundary.
  • Makes domain assignment patches idempotent by replacing the complete relationship array.

Confidence Score: 5/5

The PR appears safe to merge because no blocking failure remains within the eligible follow-up review scope.

No blocking failure remains.

Important Files Changed

Filename Overview
openmetadata-ui/src/main/resources/ui/playwright/utils/apiResponse.ts Introduces the shared API response validation, transient retry, 409 adoption, and structural FQN-quoting helpers.
openmetadata-ui/src/main/resources/ui/playwright/support/domain/Domain.ts Uses validated create and patch responses and supports adopting a concurrently created domain.
openmetadata-ui/src/main/resources/ui/playwright/support/entity/TableClass.ts Applies guarded response parsing across hierarchical table fixture creation and mutation.
openmetadata-ui/src/main/resources/ui/playwright/support/access-control/PoliciesClass.ts Adopts an existing policy after a duplicate-create conflict and validates patch responses.
openmetadata-ui/src/main/resources/ui/playwright/support/access-control/RolesClass.ts Adopts an existing role after a duplicate-create conflict.
openmetadata-ui/src/main/resources/ui/playwright/utils/domain.ts Updates shared domain setup patches to replace the domain relationship array idempotently.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Create fixture] --> B{Response status}
  B -->|2xx| C[Parse validated JSON]
  B -->|404| D[Retry create briefly]
  D --> B
  B -->|409| E[Build and quote entity FQN]
  E --> F[Fetch existing entity with requested fields]
  F --> C
  B -->|Other failure| G[Throw status and response body]
  C --> H[Store usable fixture state]
Loading

Reviews (10): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile

ShaileshParmar11 and others added 8 commits August 19, 2026 12:25
Support classes assigned `await response.json()` onto their `responseData`
without checking the response first. On a non-2xx the *error* body became the
entity's state: `id` and `fullyQualifiedName` vanished, nothing threw, and the
run broke much later somewhere unrelated.

Traces from four EKS nightly runs show this end to end. In PlatformLineage a
409 race on fixture creation is recovered correctly, then the follow-up domain
PATCH returns 400, the error body overwrites the table, and the empty FQN sends
`visitEntityPage` down its search branch with an empty search term - which fires
no request, so an unrelated `waitForResponse` burns its full 30s. In
NotificationTemplate, POST /policies and POST /roles both 409, the error bodies
land on `responseData`, and the subsequent user PATCH sends an undefined role id
and gets a 500 - so the permission never applies and the assertion fails.

Add two shared helpers in playwright/utils/apiResponse.ts:

- `okJson` throws with the status and body instead of returning an error
  payload. Applied to the 107 create/patch reads that were unguarded. Cleanup
  deletes are deliberately left alone, since a 404 there means "already gone".
- `createOrFetch` treats 409 as success and fetches the existing entity by name,
  matching the helper already in TableClass. Applied to the collections that
  actually 409ed across 113 traces: policies (8), roles (8), databaseServices
  (16), databases (5), databaseSchemas (5), tables (4) and glossaries.

The server itself was never slow - across those 113 traces only 2 had any API
call over 3s, and the median per-trace worst case was 422ms. These waits were
dead waits, not slow responses.

Verified: `tsc -p playwright/tsconfig.json` error set is unchanged from
origin/main (163 before, 163 after; zero introduced once import line-shifts are
normalised), and the CI lint sequence is idempotent with 0 errors.

Co-Authored-By: Claude Opus 5 <[email protected]>
The method tracker used to decide which `.json()` reads to guard also matched
`if (`, `for (` and `while (`, so tracking broke at the first conditional inside
a method and every later read in that method was skipped. Five sites slipped
through, including `TableClass.patch` - the exact call whose 400 response
corrupts the table entity and sends PlatformLineage into a 30s dead wait, which
is the failure this change exists to fix.

Also repairs the import block in GlossaryTerm.ts: the insertion put the new
import inside a multi-line import, which broke parsing for the whole project.

Verified again: `tsc -p playwright/tsconfig.json` is 163 before and 163 after
with zero introduced and zero removed, the lint sequence is idempotent, and no
delete/cleanup path is guarded (112 okJson sites: 61 create, 42 patch, 9 misc).

Co-Authored-By: Claude Opus 5 <[email protected]>
…ng entity

The 409 adoption path fetched the existing entity with a bare
`GET .../name/<fqn>`. The API answers `null` for every field the caller did not
ask for, so an adopted table reported `domains: null` even though a domain was
already attached - the trace shows exactly that, `domains: null` on a table at
version 0.2. The caller then re-applied its own `add /domains/0` and the server
rejected it:

  {"code":400,"errorType":"RULE_VIOLATION",
   "message":"Rule [Multiple Domains are not allowed] validation failed ..."}

So adoption was handing back an entity that looked untouched purely because the
lookup never asked, which is what made the follow-up patch fail. TableClass now
requests `fields=domains,owners,tags`, and `createOrFetch` takes an optional
`fields` so other callers can do the same.

The default stays "no fields" deliberately: `fields` is validated per collection
and an unknown name is a 400. `policies` allows only owners,location,teams,roles
and `roles` only policies,teams,users, so a blanket default would have broken
adoption for exactly the two collections this change set out to fix.

Verified: tsc unchanged from origin/main (163/163, zero introduced), lint clean.

Note this does not by itself make PlatformLineage pass - the caller must also
stop re-adding a domain it can now see is present. That is 25 inline
`path: '/domains/0'` sites, some of which legitimately add a second domain to a
User or Team, so it needs its own change rather than a blanket rewrite.

Co-Authored-By: Claude Opus 5 <[email protected]>
`op: 'add', path: '/domains/0'` appends. On a data asset the server allows only
one domain, so the op succeeds on a fresh entity and fails on one that already
has a domain:

  {"code":400,"errorType":"RULE_VIOLATION",
   "message":"Rule [Multiple Domains are not allowed] validation failed ..."}

That is what a worker hits after losing a create race: it adopts the entity the
winner already configured, then re-applies its own domain. Switching to
`path: '/domains'` with an array value sets the field instead of appending, so
the same assignment lands the same way whether the entity was just created or
adopted. `domainIsolationUtils.ts` already patched tables this way, so the form
is established.

56 ops across 25 files. The four `testUser` sites are deliberately left on
`/domains/0`: Users and Teams are the documented exception to the single-domain
rule, and appending is the behaviour those tests want.

With this, the PlatformLineage chain closes end to end - 409 on the fixtures is
absorbed by createOrFetch, the adoption lookup now reports the existing domain,
and the domain assignment no longer conflicts, so the empty search term and its
30s dead wait never happen.

Verified: tsc unchanged from origin/main (163/163, zero introduced), lint 0
errors and idempotent, and only the intended path/value lines differ - the
matching id/name lines in the diff are prettier re-indentation.

Co-Authored-By: Claude Opus 5 <[email protected]>
…ty classes

Widens 409 tolerance from the collections that were observed failing to every
service class plus the entity classes whose fixture shape is unambiguous:
all ten `*ServiceClass` files, and Topic, Chart, MlModel, SearchIndex, Metric.
That brings 22 of 47 creating classes onto the shared helper.

FQNs are declared per collection rather than inferred. A wrong FQN turns a
recoverable 409 into a hard "failed to fetch existing", so nothing here is
guessed: services are top level (`entity.name`), the five entity classes hang
off a service (`${service.name}.${entity.name}`) which their own payloads
confirm, and every target's `GET .../name/{fqn}` endpoint was checked against
its Java resource.

Left on raw POST deliberately, because the lookup is not a plain name-addressed
create and a bad guess is worse than the status quo: BundleTestSuite (deploy and
trigger endpoints, not entity creation), Task, UserClass (`/users/signup`, whose
lookup lives on a different path), Alert, KnowledgeCenter, LearningResource, and
the multi-child builders (Dashboard, Container, ApiCollection, ApiEndpoint,
StoredProcedure, the Drive chain, Tag, GlossaryTerm, SubDomain, DataProduct,
Team, Bot, Persona, Classification). None of these 409ed in the 113 traces.

Verified: tsc unchanged from origin/main (163/163, zero introduced, zero
removed), eslint 0 errors, and every `delete()` in the five entity classes is
byte-identical to main — an earlier global replace had silently rewritten their
returns and orphaned a declaration.

Co-Authored-By: Claude Opus 5 <[email protected]>
Found by running the converted classes against a live 2.0.0-SNAPSHOT server:
Domain.create adopted nothing and failed outright.

  Domain.create: fetch existing "PW%domain.1e518933" failed (404):
  {"code":404,"message":"domain instance for PW%domain.1e518933 not found"}

Domain names are generated as `PW%domain.${uuid}`, and `.` separates FQN
segments, so the adoption lookup asked for a two-segment FQN that does not
exist. Confirmed directly against the server: the unquoted name 404s, the quoted
form returns 200.

Add `quoteFqnSegment` and use it for the Domain lookup. Of the classes now on
createOrFetch only Domain generates a dotted name, but the helper is exported so
DataProduct and SubDomain can use it when they are converted.

This was exactly the failure mode the conservative scoping was meant to avoid -
a wrong FQN turning a recoverable 409 into a hard error - and it shipped anyway
in the one class where the name carried a separator. Static checks could not see
it; only executing the code did.

Verified by running the real support classes against the server: adoption on 409
now succeeds for DatabaseService, MessagingService, Topic, Policy, Role and
Domain, and okJson raises status plus body on a 404. tsc unchanged from
origin/main (163/163), eslint 0 errors.

Co-Authored-By: Claude Opus 5 <[email protected]>
…utomatic

Quoting one call site was the wrong shape: the next fixture name that happens to
contain a separator would break the same way, silently. Move composition into the
helper instead.

- `quoteFqnSegment` now mirrors the server exactly. `FullyQualifiedName.quoteName`
  escapes an embedded quote by doubling it (`"` -> `""`); the previous version
  backslash-escaped it, which was wrong for any name containing a quote.
- `buildFqn(...segments)` quotes each raw name and joins them.
- `createOrFetch` takes `fqnSegments: string[]` rather than a pre-built string, so
  no call site knows the escaping rules. All 25 sites converted.
- TableClass's own helper composed lookups as `${parent.fullyQualifiedName}.${name}`.
  The parent was escaped but the appended name was not, so it had the same latent
  bug; it now builds from raw names through `buildFqn` too.

Validated against a running server, including the case that would previously have
slipped through — a table whose own name carries a separator, created and then
adopted at full FQN depth:

  quoteFqnSegment('has.dot')        -> "has.dot"
  quoteFqnSegment('has"quote')      -> "has""quote"
  buildFqn('svc','has.dot','leaf')  -> svc."has.dot".leaf

7/7 checks pass: adoption on 409 for DatabaseService, MessagingService, Topic,
Policy, Role, Domain and a dotted-name Table, plus okJson raising status and body.
tsc unchanged from origin/main (163/163), eslint 0 errors.

Co-Authored-By: Claude Opus 5 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@github-actions github-actions Bot added safe to test Add this label to run secure Github workflows on PRs UI UI specific issues labels Aug 19, 2026
@github-actions

github-actions Bot commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

🔴 Playwright Results — workflow failed

Validated commit 6dc1c1348b5c8ec86c97844fb2b79d7444966ad3 in Playwright run 32343777165, attempt 1.

✅ 1009 passed · ❌ 1 failed · 🟡 4 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky

Performance

Blocking targets: ❌ unmet · Optimization targets: 🟡 in progress

Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting.

🕒 Full workflow signal wall (to summary) 55m 31s

⏱️ Max setup 5m 0s · max shard execution 20m 22s · max shard-job elapsed before upload 23m 41s · reporting 19s

🌐 211.42 requests/attempt · 2.43 app boots/UI scenario · 25.78% common-shard skew

Optimization targets still in progress:

  • Common shard skew was 25.78% (convergence target: at most 15%).
  • Browser traffic was 211.42 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.43 per UI scenario (2520 boots / 1039 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
🟡 Shard chromium-01 100 0 2 0 0 0
✅ Shard chromium-02 145 0 0 0 0 0
🟡 Shard chromium-03 118 0 1 0 0 0
✅ Shard chromium-04 117 0 0 0 0 0
✅ Shard chromium-05 107 0 0 0 0 0
🔴 Shard chromium-06 138 1 1 0 0 0
✅ Shard chromium-07 131 0 0 0 0 0
✅ Shard data-asset-rules-01 61 0 0 0 0 0
✅ Shard domain-isolation-01 14 0 0 0 0 0
✅ Shard global-state-01 34 0 0 0 0 0
✅ Shard ingestion-01 1 0 0 0 0 0
✅ Shard reindex-01 3 0 0 0 0 0
✅ Shard search-01 11 0 0 0 0 0
✅ Shard search-rbac-01 29 0 0 0 0 0

Genuine Failures (failed on all attempts)

❌ Pages/InputOutputPorts.spec.ts › Remove last port shows empty state (shard chromium-06)
Error: Test timeout of 60000ms exceeded
🟡 4 flaky test(s) (passed on retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify Impact Analysis service filter selection (shard chromium-01, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage schema filter selection (shard chromium-01, 1 retry)
  • Pages/Lineage/LineageInteraction.spec.ts › Verify node panel opens on click (shard chromium-03, 1 retry)
  • Pages/InputOutputPorts.spec.ts › Output port drawer only shows data product assets (shard chromium-06, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

The guard did its job — every CI failure was a latent bug it exposed, not a new
one. Four distinct causes, from the run's traces:

1. `SubDomain.create failed (404): domain instance for PW%domain.dc7e6578 not
   found` (3 tests). SubDomain sends `parent: responseData.fullyQualifiedName ??
   data.name`, and the fallback passed the raw dotted name, which the FQN parser
   reads as two segments. Quote it. Pre-existing; the 404 used to be swallowed and
   the test carried on with a subdomain that was never created.

2. `PoliciesClass.create failed (400): EL1004E: Method hasDomain(java.lang.String)
   cannot be found` (4 tests). `RuleEvaluator.hasDomain()` takes no arguments, but
   DomainAdvanced.spec.ts passed the domain FQN to it. Also pre-existing (same on
   origin/main), so that policy has never once been created and the test asserted
   against permissions it never applied. Drop the argument.

3. `DataProduct.addAssets failed (400)` with `numberOfRowsFailed: 1` and a
   `failedRequest` list. That is the bulk endpoint's partial-failure report, not a
   transport error, so the caller is meant to read the body. Reverted to a plain
   `.json()` for that one method.

4. `SpreadsheetClass.create failed (409)`. Exactly the case the earlier scoping
   left on raw POST, and it surfaced on the first CI run. Converted to
   createOrFetch.

Validated against a running server (4/4): a subdomain now resolves its dotted
parent, SpreadsheetClass adopts on 409, `hasDomain()` is accepted, and
`hasDomain('x')` still rejects with EL1004E so the fix is aimed at the real cause.

tsc unchanged from origin/main (163/163), eslint 0 errors.

Co-Authored-By: Claude Opus 5 <[email protected]>
A nightly AUT shard recorded POST /policies answering 201, POST /roles
referencing that exact policy id answering 404 "policy instance ... not
found" 15ms later, and DELETE of the same id answering 200 a further 58ms
on. The row was committed throughout; only the reference lookup lagged, so
the create had no reason to fail the try. createOrFetch now retries a 404
up to three times with a widening delay before giving up.

Also route PersonaClass and ClassificationClass through createOrFetch --
both were guarded but not 409-tolerant, and both surfaced as flaky with
"Entity already exists" in the same run.
The mirror of the create-side race, seen in the same AUT run as
"ApiServiceClass.patch failed (404): apiService instance ... not found"
against the id its own create had just returned. A 404 means the request
was rejected outright, so nothing was partially applied and re-sending is
safe.

withNotFoundRetry wraps all 41 apiContext.patch call sites across the
support classes. Wrapping rather than rewriting each body keeps every
site's existing okJson label and downstream handling untouched.
createRole.policies is an array of entityName, so the server resolves each
entry by name. Pagination's Roles setup passed policy.responseData.id, so
every role create answered 404 "policy instance for <uuid> not found" --
deterministically, not as a race: a trace shows all four attempts failing
1.8s apart while DELETE /policies/<that id> succeeds 38ms later.

Every other RolesClass.create call site already passes .name or
.fullyQualifiedName; this was the lone outlier.
Seven describe blocks seeded entities and never removed them: metrics,
notification alerts, observability alerts, roles, policies, bots, and the
tasks pipeline. Every block that did clean up was deleting a parent service
and relying on the cascade, so the top-level types -- which have no parent
-- leaked ~140 rows per run into the list endpoints other specs read.

The roles teardown runs before the policy it references.
@gitar-bot

gitar-bot Bot commented Aug 20, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Updates Playwright support classes to validate API responses and adopt existing entities on 409 conflicts, addressing swallowed failed responses. No issues found.

Options

Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

This branch was previously deployed

1 inactive deployment
test — af444ef1 Deployed Aug 20, 2026 by ShaileshParmar11 via RDF Playwright execution #3939
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Playwright support classes swallow failed API responses, corrupting fixture state

3 participants