Skip to content

Make ConnectWithRevocation_StapledOcsp more resilient to being slow - #70413

Merged
bartonjs merged 1 commit into
dotnet:mainfrom
bartonjs:test_resilience
Jun 15, 2022
Merged

bartonjs merged 1 commit into
dotnet:mainfrom
bartonjs:test_resilience

Conversation

@bartonjs

@bartonjs bartonjs commented Jun 7, 2022

Copy link
Copy Markdown
Member

On my Linux dev box this actually speeds up the ConnectWithRevocation_StapledOcsp(false) test from a 200ms delay to a 6ms delay (combination of reflection and await), but should also make it better handle high load and the background HTTP loopback fetch taking longer than 200ms.

Fixes #70322.

@ghost ghost assigned bartonjs Jun 7, 2022
@ghost

ghost commented Jun 7, 2022

Copy link
Copy Markdown

Tagging subscribers to this area: @dotnet/ncl, @vcsjones
See info in area-owners.md if you want to be subscribed.

Issue Details

On my Linux dev box this actually speeds up the ConnectWithRevocation_StapledOcsp(false) test from a 200ms delay to a 6ms delay (combination of reflection and await), but should also make it better handle high load and the background HTTP loopback fetch taking longer than 200ms.

Fixes #70322.

Author: bartonjs
Assignees: -
Labels:

area-System.Net.Security

Milestone: -

if (offlineContext.GetValueOrDefault(false))
{
// Add a delay just to show we're not winning because of race conditions.
await Task.Delay(200);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if this isn't "long enough"? Will the test still be flaky or is it just potentially a false negative?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From a white-box perspective, this delay doesn't actually do anything. Because offlineContext is true the context isn't ever going to download an OCSP payload, so we're not helping the test pass or fail by delaying.

From a black-box/future-proofing perspective, the delay adds some confidence that the test isn't just passing by being faster than the product.

The intermittent failures are associated with the parameters that hit the else (that's now powered by reflecting to grab the task to ensure that we don't race ahead).

@wfurt wfurt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
We can keep watching the test runs.
It is curious that all the linked failures are on systems with old OpenSSL.

@bartonjs
bartonjs merged commit 1e97f7c into dotnet:main Jun 15, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Jul 16, 2022
@karelz karelz added this to the 7.0.0 milestone Jul 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test failure System.Net.Security.Tests.CertificateValidationRemoteServer.ConnectWithRevocation_StapledOcsp(offlineContext: False)

4 participants