Repository navigation
Commit f64d61d
fix(o11y): batch the event flush into one cy.task call [SDK-7399]
The real cause of the reported skipping is a TIMEOUT, not an exception. Nothing throws:
build-info on a reproducing build reports failed:0, success:6, ignored:27 with all three
sessions status=error at ~985s against spec_timeout 900000ms. The specs are killed at
spec_timeout and every test that has not run yet is reported as skipped.
Each cy.task round-trip costs roughly 0.8s on a remote terminal. Measured there, 6 tests
per spec, N events per afterEach:
N=1 -> 6 calls -> 113s N=100 -> 600 calls -> 581s
N=10 -> 60 calls -> 114s N=1000 -> 6000 calls -> session killed
A command-heavy test queues hundreds of events, so the old one-cy.task-per-event flush
spent minutes in the hook and blew the spec budget. Locally the same dispatch is
effectively free, which is why every local run passed.
Batching verified before writing this: the same 600 events sent as ONE cy.task call
completed in 109s versus 581s as 600 calls -- i.e. back to baseline.
Changes:
- plugin: new test_observability_batch task takes an array and fans out to the same IPC
events; the four individual tasks stay registered for backward compatibility.
- cypress: the flush builds one batch per drain, split at 512KB so each call stays under
the ~1MB per-payload ceiling also measured on the remote (768KB passes, 1MB fails).
- shouldSkipCommand filters test_observability_batch, otherwise each batch dispatch would
be captured as a command event and refill the queue.
- sanitizeForTask keeps the 128KB payload cap with 8KB string truncation.
This supersedes the earlier cy.now approach, which stopped the skipping only by never
delivering anything: cy.now('task') throws on Cypress 14 in every context, so all
browser-side telemetry silently disappeared from the dashboard.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent a0ef0be commit f64d61d
2 files changed
Lines changed: 63 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
| 34 | + | |
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
| |||
84 | 83 | | |
85 | 84 | | |
86 | 85 | | |
87 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
| |||
384 | 385 | | |
385 | 386 | | |
386 | 387 | | |
387 | | - | |
| 388 | + | |
388 | 389 | | |
389 | 390 | | |
390 | 391 | | |
391 | 392 | | |
392 | 393 | | |
393 | 394 | | |
394 | 395 | | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
395 | 400 | | |
396 | 401 | | |
397 | 402 | | |
398 | 403 | | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
399 | 421 | | |
400 | 422 | | |
401 | 423 | | |
| |||
404 | 426 | | |
405 | 427 | | |
406 | 428 | | |
407 | | - | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
408 | 433 | | |
409 | | - | |
| 434 | + | |
410 | 435 | | |
411 | 436 | | |
| 437 | + | |
| 438 | + | |
412 | 439 | | |
413 | 440 | | |
414 | 441 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
14 | 21 | | |
15 | 22 | | |
16 | 23 | | |
| |||
27 | 34 | | |
28 | 35 | | |
29 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
30 | 60 | | |
31 | 61 | | |
32 | 62 | | |
| |||
0 commit comments