8000 [tests-only][full-ci] added test to resume all uploads sessions by PrajwolAmatya · Pull Request #11307 · owncloud/ocis · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[tests-only][full-ci] added test to resume all uploads sessions #11307

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

PrajwolAmatya
Copy link
Contributor

Description

This PR adds test to resume all the uploads sessions using the CLI command.

ocis storage-users uploads sessions --resume

While resuming the upload sessions, currently it returns an error, reported in #11290.

Related Issue

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

Comment on lines 158 to 163
And user "Alice" has created a new TUS resource in the space "Personal" with 8000 the following headers:
| Upload-Length | 10 |
# dGV4dEZpbGUudHh0 is the base64 encode of textFile.txt
| Upload-Metadata | filename dGV4dEZpbGUudHh0 |
| Tus-Resumable | 1.0.0 |
And user "Alice" has uploaded file with checksum "SHA1 8cb2237d0679ca88db6464eac60da96345513964" to the last created TUS Location with offset "0" and content "12345" via TUS inside of the space "Personal" using the WebDAV API
Copy link
Contributor

Choose a reason for hiding this comment

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

any use of using tus

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will make the upload post processing state false.

Copy link
Contributor
@amrita-shrestha amrita-shrestha May 13, 2025

Choose a reason for hiding this comment

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

as per my understanding resume should start uploading from the point where the upload has corrupt/unfinish. Above step upload Upload-Length of 5 out of 10 but we never send remaining 5 then how would ocis resume upload?

@issue-11290
Scenario: resume all uploads sessions
Given the config "POSTPROCESSING_DELAY" has been set to "10s"
And user "Alice" has created a new TUS resource in the space "Personal" with the following headers:
Copy link
Contributor
@amrita-shrestha amrita-shrestha May 13, 2025

Choose a reason for hiding this comment

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

what make this scenario full proof that we have unfinish upload in every run

Copy link
Contributor Author
@PrajwolAmatya PrajwolAmatya May 13, 2025

Choose a reason for hiding this comment

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

There is test coverage to clean upload sessions that are not in post-processing processing=false with similar step. This proves the upload is unfinished.

Scenario: clean upload sessions that are not in post-processing and is not virus infected

Copy link
Contributor

Choose a reason for hiding this comment

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

could you try this below tests case manually and see whether resume command works or not

  • Given the config "POSTPROCESSING_DELAY" has been set to "10s"
  • upload resources
  • stop ocis server
  • list upload session ./ocis/bin/ocis storage-users uploads sessions
  • try to do resume ./ocis/bin/ocis storage-users uploads sessions --resume

Copy link
Contributor Author

Choose a reason for hiding this comment

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

could you try this below tests case manually and see whether resume command works or not

  • Given the config "POSTPROCESSING_DELAY" has been set to "10s"
  • upload resources
  • stop ocis server
  • list upload session ./ocis/bin/ocis storage-users uploads sessions
  • try to do resume ./ocis/bin/ocis storage-users uploads sessions --resume

with this steps ./ocis/bin/ocis storage-users uploads sessions returns the upload sessions with processing status true.

Sessions:
+--------------------------------------+--------------------------------------+---------------------+--------+--------+--------------------------------------+--------------------------------------+---------------------------+------------+----------------------+-------------+
|                Space                 |              Upload Id               |        Name         | Offset |  Size  |              Executant               |                Owner                 |          Expires          | Processing |      Scan Date       | Scan Result |
+--------------------------------------+--------------------------------------+---------------------+--------+--------+--------------------------------------+--------------------------------------+---------------------------+------------+----------------------+-------------+
| 82313778-1e3c-4fb4-a391-543567e57897 | 9c028320-7338-4079-9eb9-5e53b91c8c60 | image-annotated.png | 107705 | 107705 | 82313778-1e3c-4fb4-a391-543567e57897 | 82313778-1e3c-4fb4-a391-543567e57897 | 2025-05-15T11:52:51+05:45 | true       | 0001-01-01T00:00:00Z |             |
+--------------------------------------+--------------------------------------+---------------------+--------+--------+--------------------------------------+--------------------------------------+---------------------------+------------+----------------------+-------------+

But, for our test case, the status of processing matters or not?

As of my understanding, for processing=true the --resume command does not make sense as the upload is already in processing state whereas processing=false means the upload process is paused or stopped and --resume flag will continue from the point where it was paused or stopped.

So, I tried to get the upload processing status False. With stopping and restarting the ocis server I couldn't get the upload processing status false. Only possible way was with TUS upload similar to the scenario mentioned in above comment.

As you mentioned in the comment #11307 (comment), that's a valid point. We should think of an alternative step.

The --resume command in every case returns the same error:

Sessions:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0xfa0d55]

goroutine 1 [running]:
github.com/owncloud/reva/v2/pkg/events.Publish({0x53ac660, 0x757f260}, {0x0, 0x0}, {0x350dd00, 0xc001e24ba0})
	/home/prajwol/www/ocis/vendor/github.com/owncloud/reva/v2/pkg/events/events.go:156 +0x3f5
github.com/owncloud/ocis/v2/services/storage-users/pkg/command.ListUploadSessions.func2(0xc001d92c80)
	/home/prajwol/www/ocis/services/storage-users/pkg/command/uploads.go:209 +0x10f2
github.com/urfave/cli/v2.(*Command).Run(0xc001b77b80, 0xc001d92c80, {0xc001e1a8c0, 0x2, 0x2})
	/home/prajwol/www/ocis/vendor/github.com/urfave/cli/v2/command.go:276 +0x7be
github.com/urfave/cli/v2.(*Command).Run(0xc001b78000, 0xc001d92bc0, {0xc001da5aa0, 0x3, 0x3})
	/home/prajwol/www/ocis/vendor/github.com/urfave/cli/v2/command.go:269 +0xa45
github.com/urfave/cli/v2.(*Command).Run(0xc001b78b00, 0xc001b90200, {0xc001b90240, 0x4, 0x4})
	/home/prajwol/www/ocis/vendor/github.com/urfave/cli/v2/command.go:269 +0xa45
github.com/urfave/cli/v2.(*Command).Run(0xc001b98160, 0xc001b90100, {0xc000050050, 0x5, 0x5})
	/home/prajwol/www/ocis/vendor/github.com/urfave/cli/v2/command.go:269 +0xa45
github.com/urfave/cli/v2.(*App).RunContext(0xc00191f600, {0x53acd38, 0xc001b08fc0}, {0xc000050050, 0x5, 0x5})
	/home/prajwol/www/ocis/vendor/github.com/urfave/cli/v2/app.go:333 +0x5a5
github.com/owncloud/ocis/v2/ocis/pkg/command.Execute()
	/home/prajwol/www/ocis/ocis/pkg/command/root.go:32 +0x1ea
main.main()
	/home/prajwol/www/ocis/ocis/cmd/ocis/main.go:11 +0x13

Copy link
Contributor

Choose a reason for hiding this comment

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

The --resume command in every case returns the same error:

@PrajwolAmatya that's new because when i opened QA ticket it was working for test case i metioned

Copy link
Contributor Author
@PrajwolAmatya PrajwolAmatya May 15, 2025

Choose a reason for hiding this comment

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

Processing true means the upload process is ongoing and the upload will be successful after the time set in POSTPROCESSING_DELAY env.
Whereas, processing false means that the upload process failed and the file will not be uploaded.

IMO, processing matters because what's the point of resuming the upload that is already in the process. But with the failed upload resume should start from the point where the upload failed.

Doc: https://owncloud.dev/services/postprocessing/#resume-postprocessing

Copy link
Contributor

Choose a reason for hiding this comment

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

please check manual whether having processing=true, auto finish their upload or not for this scenario

Given the config "POSTPROCESSING_DELAY" has been set to "10s"
upload resources
stop ocis server
list upload session ./ocis/bin/ocis storage-users uploads sessions
restart ocis
wait for 10s and see wether resource finish its upload or not ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

please check manual whether having processing=true, auto finish their upload or not for this scenario

Given the config "POSTPROCESSING_DELAY" has been set to "10s"
upload resources
stop ocis server
list upload session ./ocis/bin/ocis storage-users uploads sessions
restart ocis
wait for 10s and see wether resource finish its upload or not ?

The resource don't get uploaded. But the confusing part is the processing value true. Since the upload didn't finish, the processing should be false IMO.

But still I am getting the same error while running the resume command. I will update the scenario and add it to the expected failure file.

Copy link
Contributor

Choose a reason for hiding this comment

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

@PrajwolAmatya please confirm with developer what is expected beahvaior

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@amrita-shrestha created an issue for that #11369

@PrajwolAmatya PrajwolAmatya force-pushed the manage-unfinished-uploads branch from 2e08b69 to 74064ea Compare May 13, 2025 05:52
Comment on lines 158 to 163
And user "Alice" has created a new TUS resource in the space "Personal" with the following headers:
| Upload-Length | 10 |
# dGV4dEZpbGUudHh0 is the base64 encode of textFile.txt
| Upload-Metadata | filename dGV4dEZpbGUudHh0 |
| Tus-Resumable | 1.0.0 |
And user "Alice" has uploaded file with checksum "SHA1 8cb2237d0679ca88db6464eac60da96345513964" to the last created TUS Location with offset "0" and content "12345" via TUS inside of the space "Personal" using the WebDAV API
Copy link
Contributor
@amrita-shrestha amrita-shrestha May 13, 2025

Choose a reason for hiding this comment

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

as per my understanding resume should start uploading from the point where the upload has corrupt/unfinish. Above step upload Upload-Length of 5 out of 10 but we never send remaining 5 then how would ocis resume upload?

@PrajwolAmatya PrajwolAmatya force-pushed the manage-unfinished-uploads branch from 74064ea to 36384f4 Compare May 26, 2025 03:31
@PrajwolAmatya PrajwolAmatya force-pushed the manage-unfinished-uploads branch from 36384f4 to 9fe4c3b Compare May 27, 2025 09:39
@PrajwolAmatya PrajwolAmatya force-pushed the manage-unfinished-uploads branch from 9fe4c3b to 4223c67 Compare June 3, 2025 04:05
@PrajwolAmatya PrajwolAmatya requested a review from anon-pradip June 3, 2025 04:06
@PrajwolAmatya PrajwolAmatya force-pushed the manage-unfinished-uploads branch from 4223c67 to b558b5b Compare June 3, 2025 08:35
@PrajwolAmatya PrajwolAmatya requested a review from saw-jan June 3, 2025 08:36
@PrajwolAmatya PrajwolAmatya force-pushed the manage-unfinished-uploads branch from b558b5b to 6b96cba Compare June 4, 2025 07:53
@PrajwolAmatya PrajwolAmatya force-pushed the manage-unfinished-uploads branch 3 times, most recently from 65041e6 to 5207ea9 Compare June 9, 2025 05:03
@PrajwolAmatya PrajwolAmatya force-pushed the manage-unfinished-uploads branch from 5207ea9 to 2332035 Compare June 9, 2025 05:45
Copy link
sonarqubecloud bot commented Jun 9, 2025

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

Successfully merging this pull request may close these issues.

5 participants
0