-
Notifications
You must be signed in to change notification settings - Fork 387
Fix #518, #522 #586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #518, #522 #586
Conversation
I'll take a look into the broken tests. |
I wouldn't change the behavior of HttpClient on this release. This is very problematic given the way everything else works. On the new/refactored code, We would use |
…stic), await containerLogsTask at the end of the GetContainerLogs_* tests
Disposing the client will not change the behavior, it is just cleaner if someone disposes
|
Are any adjustments necessary? |
@HofmeisterAn is there any other way to check if the DockerClient timeout is being considered on each call? I couldn't come out with any alternative |
@dgvives what do you mean by "any other way"? Looking into the |
@HofmeisterAn the default timeout is used to create a CancellationToken for the http request. https://github.com/dotnet/Docker.DotNet/blob/master/src/Docker.DotNet/DockerClient.cs#L370-L378 if (timeout != SInfiniteTimeout)
{
using (var timeoutTokenSource = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken))
{
timeoutTokenSource.CancelAfter(timeout);
return await _client.SendAsync(request, completionOption, timeoutTokenSource.Token)
.ConfigureAwait(false);
}
} The test to verify that the request is cancelled after the specified timeout was done using a non-streamed call to DockerClient, in this case |
Ah now I get it, you reffering to:
Somewhere I had an example that behaves (partially) like an HTTP Docker endpoint (I used it to do some load tests). Maybe we can use this, to enable the test again. I will take a look into it (share it) in the next days. Have some nice holidays. |
@galvesribeiro The first commit disposes the
HttpClient
. Usually, you would like to keep a single instance of theHttpClient
for the entire application. I am not certain if that works with the current implementation. That's why I kept it as a non static field, disposing it makes sense then.The second one removes the extra properties. I double-checked them against the API docs.
pull
andoutputs
where part of e43cdd9 and detected by my script (as I said, I didn't really check the other way around).Closes #518, closes #522.