Skip to content

Commit 58c015d

Browse files
author
Oleksandr Poliakov
committed
Fix tests
1 parent 5227d00 commit 58c015d

File tree

10 files changed

+48
-48
lines changed

10 files changed

+48
-48
lines changed

src/MongoDB.Driver/Core/Bindings/CoreSession.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public bool IsInTransaction
146146
EnsureAbortTransactionCanBeCalled(nameof(AbortTransaction));
147147

148148
// TODO: CSOT implement proper way to obtain the operationContext
149-
var operationContext = new OperationContext(Timeout.InfiniteTimeSpan, cancellationToken);
149+
var operationContext = new OperationContext(null, cancellationToken);
150150
try
151151
{
152152
if (_currentTransaction.IsEmpty)
@@ -197,7 +197,7 @@ public bool IsInTransaction
197197
EnsureAbortTransactionCanBeCalled(nameof(AbortTransaction));
198198

199199
// TODO: CSOT implement proper way to obtain the operationContext
200-
var operationContext = new OperationContext(Timeout.InfiniteTimeSpan, cancellationToken);
200+
var operationContext = new OperationContext(null, cancellationToken);
201201
try
202202
{
203203
if (_currentTransaction.IsEmpty)
@@ -297,7 +297,7 @@ public long AdvanceTransactionNumber()
297297
EnsureCommitTransactionCanBeCalled(nameof(CommitTransaction));
298298

299299
// TODO: CSOT implement proper way to obtain the operationContext
300-
var operationContext = new OperationContext(Timeout.InfiniteTimeSpan, cancellationToken);
300+
var operationContext = new OperationContext(null, cancellationToken);
301301
try
302302
{
303303
_isCommitTransactionInProgress = true;
@@ -334,7 +334,7 @@ public long AdvanceTransactionNumber()
334334
EnsureCommitTransactionCanBeCalled(nameof(CommitTransaction));
335335

336336
// TODO: CSOT implement proper way to obtain the operationContext
337-
var operationContext = new OperationContext(Timeout.InfiniteTimeSpan, cancellationToken);
337+
var operationContext = new OperationContext(null, cancellationToken);
338338
try
339339
{
340340
_isCommitTransactionInProgress = true;

src/MongoDB.Driver/Core/Misc/Feature.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ public void ThrowIfNotSupported(IMongoClient client, CancellationToken cancellat
570570
{
571571
var cluster = client.GetClusterInternal();
572572
// TODO: CSOT implement proper way to obtain the operationContext
573-
var operationContext = new OperationContext(Timeout.InfiniteTimeSpan, cancellationToken);
573+
var operationContext = new OperationContext(null, cancellationToken);
574574
using (var binding = new ReadWriteBindingHandle(new WritableServerBinding(cluster, NoCoreSession.NewHandle())))
575575
using (var channelSource = binding.GetWriteChannelSource(operationContext))
576576
using (var channel = channelSource.GetChannel(operationContext))
@@ -589,7 +589,7 @@ public async Task ThrowIfNotSupportedAsync(IMongoClient client, CancellationToke
589589
{
590590
var cluster = client.GetClusterInternal();
591591
// TODO: CSOT implement proper way to obtain the operationContext
592-
var operationContext = new OperationContext(Timeout.InfiniteTimeSpan, cancellationToken);
592+
var operationContext = new OperationContext(null, cancellationToken);
593593
using (var binding = new ReadWriteBindingHandle(new WritableServerBinding(cluster, NoCoreSession.NewHandle())))
594594
using (var channelSource = await binding.GetWriteChannelSourceAsync(operationContext).ConfigureAwait(false))
595595
using (var channel = await channelSource.GetChannelAsync(operationContext).ConfigureAwait(false))

src/MongoDB.Driver/Core/Operations/AsyncCursor.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ private CursorBatch<TDocument> ExecuteGetMoreCommand(IChannelHandle channel, Can
220220
try
221221
{
222222
// TODO: CSOT: Implement operation context support for Cursors
223-
var operationContext = new OperationContext(Timeout.InfiniteTimeSpan, cancellationToken);
223+
var operationContext = new OperationContext(null, cancellationToken);
224224
result = channel.Command<BsonDocument>(
225225
operationContext,
226226
_channelSource.Session,
@@ -250,7 +250,7 @@ private async Task<CursorBatch<TDocument>> ExecuteGetMoreCommandAsync(IChannelHa
250250
try
251251
{
252252
// TODO: CSOT: Implement operation context support for Cursors
253-
var operationContext = new OperationContext(Timeout.InfiniteTimeSpan, cancellationToken);
253+
var operationContext = new OperationContext(null, cancellationToken);
254254
result = await channel.CommandAsync<BsonDocument>(
255255
operationContext,
256256
_channelSource.Session,
@@ -276,7 +276,7 @@ private async Task<CursorBatch<TDocument>> ExecuteGetMoreCommandAsync(IChannelHa
276276
private void ExecuteKillCursorsCommand(IChannelHandle channel, CancellationToken cancellationToken)
277277
{
278278
// TODO: CSOT: Implement operation context support for Cursors
279-
var operationContext = new OperationContext(Timeout.InfiniteTimeSpan, cancellationToken);
279+
var operationContext = new OperationContext(null, cancellationToken);
280280
var command = CreateKillCursorsCommand();
281281
var result = channel.Command(
282282
operationContext,
@@ -298,7 +298,7 @@ private void ExecuteKillCursorsCommand(IChannelHandle channel, CancellationToken
298298
private async Task ExecuteKillCursorsCommandAsync(IChannelHandle channel, CancellationToken cancellationToken)
299299
{
300300
// TODO: CSOT: Implement operation context support for Cursors
301-
var operationContext = new OperationContext(Timeout.InfiniteTimeSpan, cancellationToken);
301+
var operationContext = new OperationContext(null, cancellationToken);
302302
var command = CreateKillCursorsCommand();
303303
var result = await channel.CommandAsync(
304304
operationContext,
@@ -418,7 +418,7 @@ private void DisposeChannelSourceIfNoLongerNeeded()
418418
private CursorBatch<TDocument> GetNextBatch(CancellationToken cancellationToken)
419419
{
420420
// TODO: CSOT implement proper way to obtain the operationContext
421-
var operationContext = new OperationContext(Timeout.InfiniteTimeSpan, cancellationToken);
421+
var operationContext = new OperationContext(null, cancellationToken);
422422
using (EventContext.BeginOperation(_operationId))
423423
using (var channel = _channelSource.GetChannel(operationContext))
424424
{
@@ -429,7 +429,7 @@ private CursorBatch<TDocument> GetNextBatch(CancellationToken cancellationToken)
429429
private async Task<CursorBatch<TDocument>> GetNextBatchAsync(CancellationToken cancellationToken)
430430
{
431431
// TODO: CSOT implement proper way to obtain the operationContext
432-
var operationContext = new OperationContext(Timeout.InfiniteTimeSpan, cancellationToken);
432+
var operationContext = new OperationContext(null, cancellationToken);
433433
using (EventContext.BeginOperation(_operationId))
434434
using (var channel = await _channelSource.GetChannelAsync(operationContext).ConfigureAwait(false))
435435
{
@@ -445,7 +445,7 @@ private bool IsMongoCursorNotFoundException(MongoCommandException exception)
445445
private void KillCursors(CancellationToken cancellationToken)
446446
{
447447
// TODO: CSOT implement proper way to obtain the operationContext
448-
var operationContext = new OperationContext(Timeout.InfiniteTimeSpan, cancellationToken);
448+
var operationContext = new OperationContext(null, cancellationToken);
449449
using (EventContext.BeginOperation(_operationId))
450450
using (EventContext.BeginKillCursors(_collectionNamespace))
451451
using (var channel = _channelSource.GetChannel(operationContext.WithTimeout(TimeSpan.FromSeconds(10))))
@@ -460,7 +460,7 @@ private void KillCursors(CancellationToken cancellationToken)
460460
private async Task KillCursorsAsync(CancellationToken cancellationToken)
461461
{
462462
// TODO: CSOT implement proper way to obtain the operationContext
463-
var operationContext = new OperationContext(Timeout.InfiniteTimeSpan, cancellationToken);
463+
var operationContext = new OperationContext(null, cancellationToken);
464464
using (EventContext.BeginOperation(_operationId))
465465
using (EventContext.BeginKillCursors(_collectionNamespace))
466466
using (var channel = await _channelSource.GetChannelAsync(operationContext.WithTimeout(TimeSpan.FromSeconds(10))).ConfigureAwait(false))

src/MongoDB.Driver/Core/Operations/ChangeStreamCursor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,15 +262,15 @@ private IAsyncCursor<RawBsonDocument> Resume(CancellationToken cancellationToken
262262
{
263263
ReconfigureOperationResumeValues();
264264
// TODO: CSOT implement proper way to obtain the operationContext
265-
var operationContext = new OperationContext(Timeout.InfiniteTimeSpan, cancellationToken);
265+
var operationContext = new OperationContext(null, cancellationToken);
266266
return _changeStreamOperation.Resume(operationContext, _binding);
267267
}
268268

269269
private async Task<IAsyncCursor<RawBsonDocument>> ResumeAsync(CancellationToken cancellationToken)
270270
{
271271
ReconfigureOperationResumeValues();
272272
// TODO: CSOT implement proper way to obtain the operationContext
273-
var operationContext = new OperationContext(Timeout.InfiniteTimeSpan, cancellationToken);
273+
var operationContext = new OperationContext(null, cancellationToken);
274274
return await _changeStreamOperation.ResumeAsync(operationContext, _binding).ConfigureAwait(false);
275275
}
276276

0 commit comments

Comments
 (0)