Commit ca2e015
Fix: flaky domain rename data products count assertion (#26542)
* Fix: flaky domain rename data products count assertion
After a domain rename, the search index update for subdomain-level data
products can lag behind the DB update due to async reindexing by the
governance-bot. The `verifyDataProductsCount` helper was doing a one-shot
`textContent()` + `toBe()` assertion that failed when the search index
hadn't converged yet.
Changes:
- Update `verifyDataProductsCount` to accept optional `{ apiContext, domainFqn }`
that uses `expect.poll()` to poll the data product search API until
`hits.total.value` matches the expected count (following the same pattern
used in glossary.ts, alert.ts, and other polling utilities)
- Switch from one-shot `toBe()` to auto-retrying `toHaveText()` for the UI check
- Pass polling options in the post-rename assertion in Domains.spec.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add HTTP status check in search API poll
Check response.ok() before parsing JSON in the expect.poll callback
to avoid silently treating 4xx/5xx errors as count=0.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Remove custom timeout from toHaveText assertion
The expect.poll already ensures the search index has converged before
the UI check, so the default Playwright timeout is sufficient.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Siddhant <siddhant@MacBook-Pro-290.local>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
(cherry picked from commit 85ad580)1 parent 5cd37e4 commit ca2e015
2 files changed
Lines changed: 56 additions & 5 deletions
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2035 | 2035 | | |
2036 | 2036 | | |
2037 | 2037 | | |
2038 | | - | |
| 2038 | + | |
| 2039 | + | |
| 2040 | + | |
| 2041 | + | |
| 2042 | + | |
2039 | 2043 | | |
2040 | 2044 | | |
2041 | 2045 | | |
| |||
Lines changed: 51 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1338 | 1338 | | |
1339 | 1339 | | |
1340 | 1340 | | |
| 1341 | + | |
| 1342 | + | |
1341 | 1343 | | |
1342 | 1344 | | |
1343 | 1345 | | |
1344 | | - | |
| 1346 | + | |
| 1347 | + | |
1345 | 1348 | | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
1346 | 1395 | | |
1347 | 1396 | | |
1348 | 1397 | | |
1349 | 1398 | | |
1350 | 1399 | | |
1351 | 1400 | | |
1352 | 1401 | | |
1353 | | - | |
1354 | | - | |
1355 | 1402 | | |
1356 | | - | |
| 1403 | + | |
1357 | 1404 | | |
1358 | 1405 | | |
1359 | 1406 | | |
| |||
0 commit comments