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

Protocol: [Performance] Add a progress indicator for uploads #28239

Closed
ryanthemanuel opened this issue Nov 3, 2023 · 7 comments · Fixed by #28277
Closed

Protocol: [Performance] Add a progress indicator for uploads #28239

ryanthemanuel opened this issue Nov 3, 2023 · 7 comments · Fixed by #28277
Assignees
Labels

Comments

@ryanthemanuel
Copy link
Collaborator

If protocol uploads take a long time for files, this could cause CI systems to time out. A possible solution to this would be to provide an iterative update to standard out (e.g. dots or something) that at least indicate that progress is being made and triggering CI not to time out

@cacieprins
Copy link
Contributor

In considering what would benefit noninteractive shells, like in CI, while also allowing for effective masking for the console output in our system test snapshots, the formatting for the upload report will likely have to change dramatically. Currently, we print a list of artifacts that were uploaded, along with their filesize and with #28226, the duration of the upload.

I'm proposing the following output formatting:

(Uploading Cloud Artifacts)

- Video - Nothing to upload
- Screenshot - [filepath] [filesize]
- Test Replay - [filesize]

Uploading 2 files ([total filesize])
Progress: . . . . . [print a dot every 15 seconds]
Screenshot (1/1) complete 
Progress: . . . . .
Test Replay complete

Uploaded 2 files in [duration]

In cases of failure:

(Uploading Cloud Artifacts)

- Video - Nothing to upload
- Screenshot - [filepath] [filesize]
- Test Replay - [filesize]

Uploading 2 files ([total filesize])
Progress: . . . . . [print a dot every 15 seconds]
Screenshot [filepath] (1/1) failed after [duration]:
  [error]
Progress: . . . . .
Test Replay complete after [duration]

Uploaded 1 file in [duration]. 1 file upload failed.

These dots would service as an activity indicator, rather than a full progress indicator. An ASCII spinning indicator would not work, due to noninteractive shell use.

@jennifer-shehane
Copy link
Member

Maybe clean it up a bit.

(Uploading Cloud Artifacts)

- Video - Nothing to upload
- Screenshot - [filepath] [filesize]
- Test Replay - [filesize]

Uploading 1 Screenshot ([total filesize]) . . . . . [print a dot every 15 seconds]
Screenshot (1/1) uploaded in [duration]

Uploading Test Replay ([total filesize]) . . . . . [print a dot every 15 seconds]
Test Replay uploaded in [duration]

@cacieprins
Copy link
Contributor

Uploads currently happen in parallel rather than serial - we could display in that way, but it would necessitate making the uploads serial instead.

@jennifer-shehane
Copy link
Member

jennifer-shehane commented Nov 3, 2023

@cacieprins What would be the implications of printing all of the upload results once all of the artifacts are done? Is that possible to do? Or way more complicated?

(Uploading Cloud Artifacts). . . . . [print a dot every 15 seconds]

- Video - 1 kB /XXX/XXX/XXX/cypress/videos/record_error.cy.js.mp4
- Screenshot - 1 kB 2/2 /XXX/XXX/XXX/cypress/screenshots/record_fail.cy.js/record fails -- fails 1 -- before each hook (failed).png
- Test Replay - 432 kb

(Uploaded Cloud Artifacts)

- Video - Uploaded 1 kB 1/1 /XXX/XXX/XXX/cypress/videos/record_error.cy.js.mp4 in [duration]
- Screenshot - Uploaded 1 kB 2/2 /XXX/XXX/XXX/cypress/screenshots/record_fail.cy.js/record fails -- fails 1 -- before each hook (failed).png in [duration]
- Test Replay - Uploaded 432 kb in [duration]

@cacieprins
Copy link
Contributor

cacieprins commented Nov 3, 2023

Completely possible, and actually a little easier. We'd just need the activity indicator between the (Uploading) and (Uploaded) message blocks, to accommodate noninteractive terminals

@jennifer-shehane
Copy link
Member

Oh right. What is the intention of listing all the stuff we're uploading before it's uploaded? I guess there could be failures somewhere? Seems like we're listing info twice...for what benefit?

@jennifer-shehane
Copy link
Member

Breaking it up

(Cloud Artifacts to Upload)

- Video - 1 kB /XXX/XXX/XXX/cypress/videos/record_error.cy.js.mp4
- Screenshot - 1 kB 2/2 /XXX/XXX/XXX/cypress/screenshots/record_fail.cy.js/record fails -- fails 1 -- before each hook (failed).png
- Test Replay - 432 kb

Uploading Cloud Artifacts. . . . . [print a dot every 15 seconds]

(Uploaded Cloud Artifacts)

- Video - Uploaded 1 kB 1/1 /XXX/XXX/XXX/cypress/videos/record_error.cy.js.mp4 in [duration]
- Screenshot - Uploaded 1 kB 2/2 /XXX/XXX/XXX/cypress/screenshots/record_fail.cy.js/record fails -- fails 1 -- before each hook (failed).png in [duration]
- Test Replay - Uploaded 432 kb in [duration]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants