forked from ravendb/ravendb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RavenDB-21028 : Operation.WaitForCompletion : don't await the additio…
…nal task if we had an error during processing, since it can cause us to hang
- Loading branch information
Showing
2 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System.Threading.Tasks; | ||
using Xunit.Abstractions; | ||
using System; | ||
using FastTests; | ||
using Raven.Client.Documents.Smuggler; | ||
using Raven.Client.Exceptions; | ||
using Tests.Infrastructure; | ||
using Xunit; | ||
|
||
namespace SlowTests.Issues | ||
{ | ||
public class RavenDB_21028 : RavenTestBase | ||
{ | ||
|
||
public RavenDB_21028(ITestOutputHelper output) : base(output) | ||
{ | ||
} | ||
|
||
[RavenFact(RavenTestCategory.Smuggler)] | ||
public async Task WaitForCompletionShouldNotHangOnFailureDuringExport() | ||
{ | ||
using var store = GetDocumentStore(); | ||
await store.Maintenance.SendAsync(new CreateSampleDataOperation()); | ||
|
||
var file = GetTempFileName(); | ||
var op = await store.Smuggler.ExportAsync(new DatabaseSmugglerExportOptions { EncryptionKey = "fakeKey" }, file); | ||
|
||
await Assert.ThrowsAsync<RavenException>(async () => await op.WaitForCompletionAsync(TimeSpan.FromSeconds(10))); | ||
|
||
} | ||
|
||
} | ||
} |