Skip to content

Added tests for mid-size and big artifacts (to reproduce a problem with chunked uploads)#1206

Closed
grigorye wants to merge 1 commit intonektos:masterfrom
grigorye:feature/Tests-For-Chunked-Uploads
Closed

Added tests for mid-size and big artifacts (to reproduce a problem with chunked uploads)#1206
grigorye wants to merge 1 commit intonektos:masterfrom
grigorye:feature/Tests-For-Chunked-Uploads

Conversation

@grigorye
Copy link
Copy Markdown
Contributor

@grigorye grigorye commented Jun 10, 2022

This should reproduce the problem (in artifacts server?) with support for chunked uploads. Namely, artifacts cut at size of 8388608 (8M).

It adds two tests (artifacts 5 and 6):

  • 5 is for mid-sized upload (1M), works fine
  • 6 is for big upload (10M), gets cut on upload at 8388608.
$ act -W pkg/artifacts/testdata/upload-and-download/artifacts.yml --artifact-server-path artifacts
....
[Test that artifact uploads and downloads succeed/test-artifacts] ⭐ Run Main Download artifact #5
[Test that artifact uploads and downloads succeed/test-artifacts]   🐳  docker cp src=/Users/eg/.cache/act/actions-download-artifact@v2/ dst=/var/run/act/actions/actions-download-artifact@v2/
[Test that artifact uploads and downloads succeed/test-artifacts]   🐳  docker exec cmd=[mkdir -p /var/run/act/actions/actions-download-artifact@v2/] user= workdir=
[Test that artifact uploads and downloads succeed/test-artifacts] close /var/folders/mp/3jr0hvr922v_32bx7309bntr0000gn/T/act2616194157: file already closed
[Test that artifact uploads and downloads succeed/test-artifacts]   🐳  docker exec cmd=[node /var/run/act/actions/actions-download-artifact@v2/dist/index.js] user= workdir=
[Test that artifact uploads and downloads succeed/test-artifacts]   💬  ::debug::Resolved path is /Users/eg/Workbench/act/mid-size/artifact/path
| Starting download for Mid-Size-Artifact
[Test that artifact uploads and downloads succeed/test-artifacts]   💬  ::debug::Artifact Url: http://192.168.2.80:34567/_apis/pipelines/workflows/1/artifacts?api-version=6.0-preview
| Directory structure has been setup for the artifact
[Test that artifact uploads and downloads succeed/test-artifacts]   💬  ::debug::Download file concurrency is set to 2
| Total number of files that will be downloaded: 1
[Test that artifact uploads and downloads succeed/test-artifacts]   💬  ::debug::/Users/eg/Workbench/act/mid-size/artifact/path/file5.rnd size:(1048576) blksize:(4096) blocks:(2048)
| Skipping download validation.
| Artifact Mid-Size-Artifact was downloaded to /Users/eg/Workbench/act/mid-size/artifact/path
[Test that artifact uploads and downloads succeed/test-artifacts]   ⚙  ::set-output:: download-path=/Users/eg/Workbench/act/mid-size/artifact/path
| Artifact download has finished successfully
[Test that artifact uploads and downloads succeed/test-artifacts]   ✅  Success - Main Download artifact #5
[Test that artifact uploads and downloads succeed/test-artifacts] ⭐ Run Main Verify Artifact #5
[Test that artifact uploads and downloads succeed/test-artifacts]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/22] user= workdir=
[Test that artifact uploads and downloads succeed/test-artifacts]   ✅  Success - Main Verify Artifact #5
[Test that artifact uploads and downloads succeed/test-artifacts] ⭐ Run Main Download artifact #6
[Test that artifact uploads and downloads succeed/test-artifacts]   🐳  docker cp src=/Users/eg/.cache/act/actions-download-artifact@v2/ dst=/var/run/act/actions/actions-download-artifact@v2/
[Test that artifact uploads and downloads succeed/test-artifacts]   🐳  docker exec cmd=[mkdir -p /var/run/act/actions/actions-download-artifact@v2/] user= workdir=
[Test that artifact uploads and downloads succeed/test-artifacts] close /var/folders/mp/3jr0hvr922v_32bx7309bntr0000gn/T/act2285776570: file already closed
[Test that artifact uploads and downloads succeed/test-artifacts]   🐳  docker exec cmd=[node /var/run/act/actions/actions-download-artifact@v2/dist/index.js] user= workdir=
[Test that artifact uploads and downloads succeed/test-artifacts]   💬  ::debug::Resolved path is /Users/eg/Workbench/act/big/artifact/path
| Starting download for Big-Artifact
[Test that artifact uploads and downloads succeed/test-artifacts]   💬  ::debug::Artifact Url: http://192.168.2.80:34567/_apis/pipelines/workflows/1/artifacts?api-version=6.0-preview
| Directory structure has been setup for the artifact
[Test that artifact uploads and downloads succeed/test-artifacts]   💬  ::debug::Download file concurrency is set to 2
| Total number of files that will be downloaded: 1
[Test that artifact uploads and downloads succeed/test-artifacts]   💬  ::debug::/Users/eg/Workbench/act/big/artifact/path/file6.rnd size:(8388608) blksize:(4096) blocks:(16384)
| Skipping download validation.
| Artifact Big-Artifact was downloaded to /Users/eg/Workbench/act/big/artifact/path
[Test that artifact uploads and downloads succeed/test-artifacts]   ⚙  ::set-output:: download-path=/Users/eg/Workbench/act/big/artifact/path
| Artifact download has finished successfully
[Test that artifact uploads and downloads succeed/test-artifacts]   ✅  Success - Main Download artifact #6
[Test that artifact uploads and downloads succeed/test-artifacts] ⭐ Run Main Verify Artifact #6
[Test that artifact uploads and downloads succeed/test-artifacts]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/24] user= workdir=
| Binary files big/artifact/path/file6.rnd and path/to/dir-6/file6.rnd differ
| File contents of downloaded artifact are incorrect
[Test that artifact uploads and downloads succeed/test-artifacts]   ❌  Failure - Main Verify Artifact #6
[Test that artifact uploads and downloads succeed/test-artifacts] exit with `FAILURE`: 1
Error: Job 'test-artifacts' failed

$ ls -l artifacts/1/*/file?.rnd
-rw-r--r--  1 eg  staff  8388608 Jun 10 09:44 artifacts/1/Big-Artifact/file6.rnd
-rw-r--r--  1 eg  staff  1048576 Jun 10 09:44 artifacts/1/Mid-Size-Artifact/file5.rnd

@grigorye grigorye requested a review from a team as a code owner June 10, 2022 07:55
@mergify

This comment was marked as off-topic.

@mergify mergify Bot added the needs-work Extra attention is needed label Jun 10, 2022
@ChristopherHX
Copy link
Copy Markdown
Contributor

I reported this issue in PR review, chunk support is not even implemented: #677 (comment)

@grigorye
Copy link
Copy Markdown
Contributor Author

grigorye commented Jun 10, 2022

I reported this issue in PR review, chunk support is not even implemented: #677 (comment)

I tried to address it here: #1208, implementing a naive handler that just appends every chunk, assuming that upload-artifact does the chunk upload sequentially.

@grigorye
Copy link
Copy Markdown
Contributor Author

Closing in favor of #1208 that implements the change, incorporating these tests.

@grigorye grigorye closed this Jun 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-work Extra attention is needed size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants