Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misc: receive afterSpec durations from app capture code, and report them to the Cloud API #29500

Merged
merged 35 commits into from
Jun 11, 2024

Conversation

cacieprins
Copy link
Contributor

@cacieprins cacieprins commented May 9, 2024

  • Closes

Additional details

Because of the bifurcation of Test Replay capture/upload logic, the durations that are recorded in the afterSpec process will be returned from the protocol capture codebase' afterSpec method. They're collected and reported to the updateInstanceArtifacts Cloud API endpoint.

Steps to test

Verify that, once the related services PR is merged and released, these durations are reported to the update instance artifacts endpoint when recording a spec with Test Replay enabled. When running against staging, these durations should be queryable in Honeycomb.

How has the user experience changed?

PR Tasks

@@ -289,6 +290,9 @@ export type ProtocolMetadata = ArtifactMetadata & {
size: number
offset: number
}
afterSpecDurations?: AfterSpecDurations & {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AfterSpecDurations is the shape that the protocol capture codebase will return; we're augmenting that with the total duration of afterSpec, so the shape is modified here.

@cacieprins cacieprins marked this pull request as ready for review May 20, 2024 16:13
@cacieprins cacieprins marked this pull request as draft May 20, 2024 17:53
@cacieprins cacieprins marked this pull request as ready for review May 20, 2024 18:06
Copy link

cypress bot commented May 20, 2024

2 flaky tests on run #55746 ↗︎

0 5557 77 0 Flakiness 2

Details:

Merge branch 'develop' into cacie/misc/record-tr-afterspec-timing
Project: cypress Commit: 53448a72d6
Status: Passed Duration: 16:06 💡
Started: Jun 11, 2024 5:15 PM Ended: Jun 11, 2024 5:31 PM
Flakiness  cypress/e2e/commands/waiting.cy.js • 2 flaky tests • 5x-driver-chrome

View Output

Test Artifacts
... > errors > throws when route is never resolved Test Replay
... > errors > throws when waiting for 2nd response to route Test Replay

Review all test suite changes for PR #29500 ↗︎

@cacieprins cacieprins requested a review from mschile May 23, 2024 15:24
await this.invokeAsync('afterSpec', { isEssential: true })
const startTime = performance.now() + performance.timeOrigin

debug({ startTime })
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we have a description here around what this is?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this debug can be removed- the important debug is on L191

fileSize: number | bigint
specAccess: ReturnType<AppCaptureProtocolInterface['getDbMetadata']>
} | undefined> {
async uploadCaptureArtifact ({ uploadUrl, fileSize, filePath }: CaptureArtifact, captureErrorsOverride?: boolean) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is captureErrorsOverride just used for testing purposes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. Could refactor a bit to have caller pass in the env var to make things a little cleaner.

@cacieprins cacieprins merged commit cec7a1b into develop Jun 11, 2024
80 of 82 checks passed
@cacieprins cacieprins deleted the cacie/misc/record-tr-afterspec-timing branch June 11, 2024 17:31
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jun 18, 2024

Released in 13.12.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v13.12.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Jun 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants