Commit Graph
59 Commits
Author SHA1 Message Date
marceloduplicatiandGitHub c4600e4237 Merge pull request #6033 from marceloduplicati/feature/fix-to-stop-unit-test
Fix to StopNow tests
2025-03-12 12:18:44 -03:00
Marcelo C. 64d40ef0ea Fix to StopNow tests
Since the core changes in the cancelation process where now cancellationTokens are observed rather than a thread.abort attempt, the expected exception is now OperationCanceledException when calling .Abort on the controller.

Also eliminated the time based awaiting to abort in favor of monitoring the backup phase to ensure the .Abort happens after the controller has had time to initiate the backend and backend is at Backup_ProcessingFiles state.
2025-03-12 10:40:20 -03:00
Kenneth Skovhede 5d45baacbf Renamed tests away from "Failed" to make searching for failed tests easier. 2025-03-10 22:04:48 +01:00
Kenneth Skovhede c673cba607 Cleanups in tests 2025-03-10 14:39:31 +01:00
Kenneth Skovhede 599203a269 Added check to see that injected failure is actually triggered 2025-03-09 22:01:01 +01:00
Kenneth Skovhede 12cabf8da7 Merge branch 'feature/improved-failure-resilience' of github.com:duplicati/duplicati into feature/improved-failure-resilience 2025-03-08 15:28:24 +01:00
Kenneth Skovhede d019845fad Added a number of new tests to ensure correct handling of edge cases related to missing/interrupted uploads. 2025-03-08 15:14:03 +01:00
Kenneth SkovhedeandGitHub f6d8ed83f0 Merge branch 'master' into feature/improved-failure-resilience 2025-03-06 22:32:37 +01:00
Kenneth Skovhede d75e690495 Fixed not being dependent on filesystem order 2025-03-06 18:26:56 +01:00
Kenneth Skovhede e3727d8f18 Finding list of modified files to trace the error 2025-03-06 15:22:57 +01:00
Kenneth Skovhede 774e468287 Placed modify correctly 2025-03-06 15:12:38 +01:00
Kenneth Skovhede 7beeb27ade Extended tests and fixed a case where a left-over upload could cause errors. 2025-03-06 14:53:46 +01:00
Kenneth Skovhede 277362ce64 Another attempt at fixing the failing tests 2025-03-06 10:48:52 +01:00
Kenneth Skovhede be0d74fe2e Attempt to make test more stable 2025-03-05 10:01:08 +01:00
Kenneth Skovhede 78b45eb983 Added additional tests for OperationCancelledException
(cherry picked from commit 30568f0498)
2025-03-04 16:37:24 +01:00
Kenneth Skovhede 655f5ef635 Added interuption test
This adds a test with a failed upload.

The failed upload is done in parallel, so (at least) one of the uploads succeeeds and one upload fails.

The backup then errors, but a subsequent backup continues without errors and creates a synthetic filelist.

Also refactored the DeterministicErrorBackend to not use magic strings.
And made it actually deterministic.
2025-02-20 11:00:28 +01:00
Kenneth SkovhedeandGitHub f7b7555e87 Fixes for tests (#5918)
* Two small test fixes

* Ignore exceptions when comitting an empty transaction

* Attempt to fix FTP connection issue

* Unified test by having a single download function.
Added DNS probing call to attempt fixing sporadic DNS errors.

* Fixed argument order

* Avoid creating temp file during tests, if not needed
2025-01-28 08:55:28 +01:00
Kenneth SkovhedeandGitHub 9464caf622 Feature/update license 2025 (#5851)
* Fixed some minor whitespace issues

* Updated all copyright to 2025
2025-01-07 09:40:39 +01:00
Carl Johnsen 4b0033d8e8 Fixed bug where if the parent folder contained the name "10", the DisruptionTests.FilesetFiles test would fail 2024-12-20 08:23:32 +01:00
Kenneth SkovhedeandGitHub ff1b2b7990 Simplified task control (#5753)
* Simplified task control by having all logic in a single class and using async control mechanism
* Fixed the tests
* Made the marking of a backup partial explicitly communicated if the enumeration process is stopped.
* Added support for pausing active transfers
* Introduced transfer token to abort operations.
* Updated the way LiveControl is emitting events.
* Retains the paused state of the server across reboots, this fixes #5760.
* Reworked the way throttle speeds are propagated through LiveControls.
* Added option to pause transfers in the UI.
* Removed throttle settings from the LiveControls class so it is exclusively handled by the ApplicationSettings.
* Removed `thread-priority` as it does not work at all when tasks are used.
* Fixed the stop dialog and API to only support stop and abort.
* Removed unused variables
2024-12-18 08:27:59 +01:00
Suguru Hirahara ae57dee0f0 Remove redundant space characters from *.cs and *.html 2024-07-26 00:10:31 -04:00
Kenneth Skovhede fcc95fa936 Fixed flaky test 2024-04-18 11:49:39 +02:00
Kenneth Skovhede 473c6cbbb8 Merge commit '4f577c65a4d8806f79637c50c21ca3a683c5a07a' into feature/kestrel-avalonia-upgrade 2024-03-04 12:21:53 +01:00
Kenneth Skovhede d7f027b9e2 Fixed usings in unit tests 2024-03-03 15:41:49 +01:00
Kenneth Skovhede aa20088c39 Tool based upgrade of all projects with some manual update 2024-03-01 14:29:54 +01:00
Kenneth Skovhede 40dd3c6816 Updated all license mentions to MIT 2024-02-28 15:45:30 +01:00
Thomas Suckow 5956b771f0 Cleanup inconsistent overrides of test SetUp and TearDown.
Also add some memory usage diagnostics
2022-05-05 22:30:15 -07:00
Dean Ferreyra f4195e4eb0 Address review comments from @warwickmm
Replace `VerifyDir` and `CompareFiles` with
`AssertDirectoryTreesAreEquivalent` and `AssertFilesAreEqual`.

Move `WriteFile` to `TestUtils`.

Add "Symlink" category to start.sh.
2020-09-11 20:06:53 -07:00
Kenneth Hsu e1a6ae4483 Check operation results for errors and warnings in tests. 2020-07-05 18:50:10 -07:00
Sean Templeton d5e064ae45 Fix a few more issues with stop now
When a backup is interrupted it will now show as a partial backup in the list of backups on the restore files page.

Temporary filelist volumes are protected from deletion in several places. All but the RestoreHandler
only protect the most recent filelist. The RestoreHandler protects all temporary filelist volumes as the user
might be restoring from one that would be deleted.

Prevent the CoCoL BackendRequests channel is retired exception from appearing when the backup is stopped by checking
if the channel is retired before trying to add the FlushRequest to the channel. Any exceptions from the BackendUploader
task will still be thrown.
2020-03-01 21:19:07 -06:00
Sean Templeton 446120ae3e A synthetic filelist could not be uploaded due to the logic in UploadSyntheticFilelist. The code passing in the fileset id to the class would get the id based on if the volume was in the Temporary or Uploading states. If the volume was in the Uploading state, present on the remote backend, and of the right size it would get changed to Uploaded.
One of the first things UploadSyntheticFilelist does is throw an exception if the volume is not in the Uploaded state. Or if it is in the Uploaded state, the next check would prevent a synthetic filelist from being created if the volume was not in the Uploading or Temporary states.

Removed the check for the volume not being in the Uploaded state as the warning in the second check handles that case.

Removed the using statement as it would dispose of the FilesetVolumeWriter after passing it to the UploadChannel. The UploadChannel could not use it since it had been disposed.

Fixed the GetRemoteVolumeFromIDAsync taking a fileset id and matching it up against a volume id. Now it will use fileset id to get the volume that matches the fileset.

Change the StopNow disruption test to not use a synthetic file list. The test was written with it not working and therefore fails a check on the number of filesets after stopping a backup.

Bonus fix for a possible null exception in Dispose for VolumeWriterBase.
2020-02-23 16:50:36 -06:00
Kenneth Hsu f63e703a66 Add test for interrupting backup with "stop now". 2020-01-06 10:00:35 -08:00
warwickmmandGitHub 1663148479 Merge pull request #4034 from warwickmm/test/no_local_db_list
Add test for listing filesets without local database
2020-01-06 09:20:40 -08:00
Kenneth Hsu d3bcd3fb4a Add test for listing filesets without local database.
This test would have failed prior to the changes in revision 8ab64071f0
("Display correct backup type when using direct restore").  Prior to
revision 8ab64071f0, all filesets would have been marked as partial when
performing a direct restore without the local database.

This concerns issue #3982.
2019-12-30 16:35:41 -08:00
Kenneth Hsu 7494abec63 Add test to verify that fileset file exists after repair.
This test would have failed prior to the changes in revision 0cfce6be39
("Include fileset file when repairing missing dlist file").

This concerns issue #3982.
2019-12-30 15:15:15 -08:00
Kenneth Hsu d3f752279f Add test to verify that fileset file exists after purge.
This test would have failed prior to the changes in revision 51b4ecfb28
("Include fileset file in dlist files after purge operation").

This concerns issue #3982.
2019-12-30 15:15:15 -08:00
Kenneth Hsu 7746ff1014 Fix derivation of seconds from TimeSpan.
Although the TimeSpan should be less than one minute, we should still
reference TotalSeconds to be safe.
2019-12-03 18:23:24 -08:00
Kenneth Hsu 30fddd4b91 Add test for retention-policy logic. 2019-11-29 22:18:02 -08:00
Kenneth Hsu 68e7844dae Add test for keep-versions logic where last backup was full.
This concerns issue #3982.
2019-11-29 14:13:15 -08:00
Kenneth Hsu 07df3d4d5e Verify backup times in addition to partial/full status. 2019-11-29 09:14:35 -08:00
Kenneth Hsu b0224194de Allow continutation after await to run in any context. 2019-11-29 09:12:15 -08:00
Kenneth Hsu 8c9512ac2c Add test for keep-versions retention logic. 2019-11-29 09:11:18 -08:00
Kenneth Hsu afecf891da Add test for keep-time retention logic.
We had to remove the keep-versions options since multiple retention
options are not allowed.

This concerns issue #3982.
2019-11-28 21:50:16 -08:00
Kenneth Hsu 9eedf757cd Extract creation of partial backup to helper method. 2019-11-28 21:47:54 -08:00
Kenneth Hsu 1d42c53319 Fix disruption test to expect partial backups in fileset listing.
This concerns issue #3982.
2019-11-19 19:30:03 -08:00
Kenneth Hsu bedecdef1d Allow execution to continue on any thread. 2019-09-17 14:16:58 -07:00
Kenneth Hsu a9ace40723 Increase dblock size to speed up testing. 2019-09-17 12:46:23 -07:00
Kenneth Hsu 2f58de4021 Remove unused using directive. 2019-09-17 12:46:23 -07:00
Kenneth Hsu e9e87a495c Disable warning. 2019-09-17 12:46:23 -07:00
Kenneth Hsu ca5a135300 Avoid checking metadata in restore tests.
There appear to be some differences at the tick level.
2019-09-17 12:46:23 -07:00