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-21852 Fixing ArgumentOutOfRangeException throw by GetOngoingT…
…askInfoOperation() for OngoingTaskType.QueueSink
- Loading branch information
1 parent
2d246d4
commit fd7cfdc
Showing
6 changed files
with
79 additions
and
35 deletions.
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
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
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
38 changes: 38 additions & 0 deletions
38
test/SlowTests/Server/Documents/QueueSink/RavenDB_21852.cs
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,38 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using Raven.Client.Documents.Operations.ETL.Queue; | ||
using Raven.Client.Documents.Operations.OngoingTasks; | ||
using Tests.Infrastructure; | ||
using Xunit; | ||
using Xunit.Abstractions; | ||
|
||
namespace SlowTests.Server.Documents.QueueSink; | ||
|
||
public class RavenDB_21852 : QueueSinkTestBase | ||
{ | ||
public RavenDB_21852(ITestOutputHelper output) : base(output) | ||
{ | ||
} | ||
|
||
[RavenFact(RavenTestCategory.ClientApi)] | ||
public void CanGetQueueSinkTaskInfo() | ||
{ | ||
using var store = GetDocumentStore(); | ||
var config = SetupRabbitMqQueueSink(store, "this['@metadata']['@collection'] = 'Users'; put(this.Id, this)", | ||
new List<string>() {UsersQueueName}); | ||
|
||
var op = new GetOngoingTaskInfoOperation(config.Name, OngoingTaskType.QueueSink); | ||
|
||
var taskInfo = (OngoingTaskQueueSink)store.Maintenance.Send(op); | ||
|
||
Assert.NotNull(taskInfo); | ||
Assert.Null(taskInfo.Error); | ||
Assert.Equal(QueueBrokerType.RabbitMq, taskInfo.BrokerType); | ||
|
||
var nonExisting = new GetOngoingTaskInfoOperation("non-existing", OngoingTaskType.QueueSink); | ||
|
||
var nullTaskInfo = (OngoingTaskQueueSink)store.Maintenance.Send(nonExisting); | ||
|
||
Assert.Null(nullTaskInfo); | ||
} | ||
} |