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

Conversation

PrajwolAmatya
Copy link
Contributor

Description

This PR adds test to restart and resume all the stale uploads using the CLI commands.

ocis storage-users uploads sessions --resume
ocis storage-users uploads sessions --restart

Currently the CLI command does not restart or resume any uploads are returns empty list, reported in #11296.

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:

@prashant-gurung899
Copy link
Contributor

LGTM 👍

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?

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.

@amrita-shrestha
Copy link
Contributor

in previous merged PR, i have doubt

 Scenario: restart upload sessions that are in postprocessing
    Given user "Alice" has uploaded file with content "upload content" to "/file1.txt"
    And the config "POSTPROCESSING_DELAY" has been set to "10s"
    And user "Alice" has uploaded file with content "upload content" to "/file2.txt" 
    When the administrator restarts the upload sessions that are in postprocessing 
    Then the command should be successful
    And the CLI response should contain these entries:
      | file2.txt |
    And the CLI response should not contain these entries:
      | file1.txt |

seems not full proof because upload can finish in between getting uploadid and restarting upload

@PrajwolAmatya
Copy link
Contributor Author

seems not full proof because upload can finish in between getting uploadid and restarting upload

If a file is listed in the response of the command then it confirms the command worked successfully as these commands are meant to output the list of uploads that match the criteria provided in the command.

@amrita-shrestha
Copy link
Contributor

seems not full proof because upload can finish in between getting uploadid and restarting upload

If a file is listed in the response of the command then it confirms the command worked successfully as these commands are meant to output the list of uploads that match the criteria provided in the command.

still not 100% guarnteed that it will never show flakiness

@PrajwolAmatya
Copy link
Contributor Author

still not 100% guarnteed that it will never show flakiness

I didn't get it, how this can be flaky?

@amrita-shrestha
Copy link
Contributor

still not 100% guarnteed that it will never show flakiness

I didn't get it, how this can be flaky?

ok try it manually. List unfinished uploads and restart that . Again, run the CLI command to restart the same resource. What will be the output: its fail or pass?

@PrajwolAmatya
Copy link
Contributor Author

PrajwolAmatya commented May 26, 2025

still not 100% guarnteed that it will never show flakiness

I didn't get it, how this can be flaky?

ok try it manually. List unfinished uploads and restart that . Again, run the CLI command to restart the same resource. What will be the output: its fail or pass?

If we again restart the upload of same resource it will restart the upload process of that resource again.

image

I think this PR is not the right place to discuss this.

We should find the answer for the following point.

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.

@PrajwolAmatya PrajwolAmatya force-pushed the restart-resume-stale-uploads branch from f0862c1 to 6975d0d Compare June 3, 2025 08:37
@PrajwolAmatya PrajwolAmatya force-pushed the restart-resume-stale-uploads branch from 6975d0d to b461af0 Compare June 4, 2025 07:55
Copy link

sonarqubecloud bot commented Jun 4, 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.

3 participants