Skip to content
This repository was archived by the owner on Jan 5, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions libraries/Microsoft.Bot.Builder.AI.QnA/QnAMaker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ public QnAMaker(QnAMakerEndpoint endpoint, QnAMakerOptions options, HttpClient h

if (httpClient == null)
{
// assign DefaultHttpClient to _httpClient to expose Timeout in unit tests
// and keep HttpClient usage as a singleton by default
DefaultHttpClient.Timeout = TimeSpan.FromMilliseconds(_options.Timeout);
_httpClient = DefaultHttpClient;
}
else
Expand Down
31 changes: 0 additions & 31 deletions tests/Microsoft.Bot.Builder.AI.QnA.Tests/QnAMakerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1025,37 +1025,6 @@ public async Task Telemetry_FillPropsOverride()
Assert.AreEqual(((Dictionary<string, double>)telemetryClient.Invocations[0].Arguments[2])["score"], 3.14159);
}

[TestMethod]
[TestCategory("AI")]
[TestCategory("QnAMaker")]
public void QnaMaker_Timeout()
{
var endpoint = new QnAMakerEndpoint
{
KnowledgeBaseId = _knowlegeBaseId,
EndpointKey = _endpointKey,
Host = _hostname,
};

var optionsWithTimeout = new QnAMakerOptions()
{
Timeout = 300000,
};
var qna = new QnAMaker(endpoint, optionsWithTimeout);
var expectedTimeout = 300000;

Assert.AreEqual(expectedTimeout, QnAMaker.DefaultHttpClient.Timeout.TotalMilliseconds);

var optionsWithNewTimeout = new QnAMakerOptions()
{
Timeout = 200000,
};
var qnaWithOverwrittenTimeout = new QnAMaker(endpoint, optionsWithNewTimeout);
var newExpectedTimeout = 200000;

Assert.AreEqual(newExpectedTimeout, QnAMaker.DefaultHttpClient.Timeout.TotalMilliseconds);
}

private static TurnContext GetContext(string utterance)
{
var b = new TestAdapter();
Expand Down