Skip to content

[tests-only][full-ci] added test to restart and resume all stale uploads #11308

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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions tests/acceptance/bootstrap/CliContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -894,4 +894,21 @@ public function theAdministratorRestoresTheTrashedResourcesOfSpaceOwnedByUser(
];
$this->featureContext->setResponse(CliHelper::runCommand($body));
}

/**
* @When /^the administrator (resumes|restarts) all the stale uploads$/
*
* @param string $flag
*
* @return void
* @throws GuzzleException
*/
public function theAdministratorResumesOrRestartsAllTheStaleUploads(string $flag): void {
$flag = rtrim($flag, "s");
$command = "storage-users uploads sessions --$flag --json";
$body = [
"command" => $command
];
$this->featureContext->setResponse(CliHelper::runCommand($body));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -406,5 +406,10 @@ The expected failures in this file are from features in the owncloud/ocis repo.
#### [Activity. no event for deleting a file using file-id](https://github.com/owncloud/ocis/issues/10328)
- [apiActivities/activitiesByFileId.feature:2017](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiActivities/activitiesByFileId.feature#L2017)

#### [[CLI]Restart and Resume stale uploads returns empty list](https://github.com/owncloud/ocis/issues/11296)

- [cliCommands/staleUpload.feature:85](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/cliCommands/staleUpload.feature#L85)
- [cliCommands/staleUpload.feature:97](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/cliCommands/staleUpload.feature#L97)

Note: always have an empty line at the end of this file.
The bash script that processes this file requires that the last line has a newline on the end.
24 changes: 24 additions & 0 deletions tests/acceptance/features/cliCommands/staleUpload.feature
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,27 @@ Feature: stale upload via CLI command
Total stale nodes: 1
"""
And there should be "0" stale uploads of space "Personal" owned by user "Alice"

@issue-11296
Scenario: resume all stale uploads
Given the config "POSTPROCESSING_DELAY" has been set to "10s"
And user "Alice" has uploaded file with content "some content" to "textfile.txt"
And the administrator has stopped the server
And the administrator has created stale upload
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are you using this step ? IMO you are testing resume command?

And the administrator has started the server
When the administrator resumes all the stale uploads
Then the command should be successful
And the CLI response should contain these entries:
| textfile.txt |

@issue-11296
Scenario: restart all stale uploads
Given the config "POSTPROCESSING_DELAY" has been set to "10s"
And user "Alice" has uploaded file with content "some content" to "textfile.txt"
And the administrator has stopped the server
And the administrator has created stale upload
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.

An unfinished upload and a stale upload are different things. I have created a stale upload by deleting the .info file, and I doubt it is possible to resume/restart the upload file from which the .info file has been deleted.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That could be the reason why the table in the response is empty. Maybe resume and restart is not possible for stale uploads.

And the administrator has started the server
When the administrator restarts all the stale uploads
Then the command should be successful
And the CLI response should contain these entries:
| textfile.txt |