mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-16 18:47:57 -05:00
Update broken BindingQueue test from previous commit (#725)
This commit is contained in:
@@ -213,10 +213,11 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.LanguageServer
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Queue an task with a long operation causing a timeout and make sure subsequent tasks still execute
|
/// Queue a task with a long operation causing a timeout
|
||||||
|
/// and make sure subsequent tasks don't execute while task is completing
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Fact]
|
[Fact]
|
||||||
public void QueueWithTimeoutRunsNextTask()
|
public void QueueWithTimeoutDoesNotRunNextTask()
|
||||||
{
|
{
|
||||||
string operationKey = "testkey";
|
string operationKey = "testkey";
|
||||||
ManualResetEvent firstEventExecuted = new ManualResetEvent(false);
|
ManualResetEvent firstEventExecuted = new ManualResetEvent(false);
|
||||||
@@ -256,13 +257,13 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.LanguageServer
|
|||||||
);
|
);
|
||||||
|
|
||||||
var result = firstEventExecuted.WaitOne(totalTimeout);
|
var result = firstEventExecuted.WaitOne(totalTimeout);
|
||||||
Assert.True(result);
|
Assert.False(result);
|
||||||
|
|
||||||
this.bindingQueue.StopQueueProcessor(15000);
|
this.bindingQueue.StopQueueProcessor(15000);
|
||||||
|
|
||||||
Assert.Equal(1, this.timeoutCallCount);
|
Assert.Equal(1, this.timeoutCallCount);
|
||||||
Assert.True(firstOperationCanceled);
|
Assert.False(firstOperationCanceled);
|
||||||
Assert.True(secondOperationExecuted);
|
Assert.False(secondOperationExecuted);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user