Skip to content

[Identity] Improve test reliability#13646

Merged
javiercn merged 2 commits intorelease/3.1from
javiercn/identity-ui-scripts-fix
Sep 4, 2019
Merged

[Identity] Improve test reliability#13646
javiercn merged 2 commits intorelease/3.1from
javiercn/identity-ui-scripts-fix

Conversation

@javiercn
Copy link
Member

@javiercn javiercn commented Sep 3, 2019

While working on infrastructure I saw these tests had some failures. They were a low hanging fruit, so I added extra error handling. There seemed to be some errors related to DNS resolution and some timeouts on the HttpClient request.

Tests failed 6 times out of 1664 (99.63% pass rate) this should hopefully bring them to 100%

@javiercn javiercn requested review from HaoK and removed request for SteveSandersonMS September 3, 2019 13:55
* Adds logging to the test.
* Retries on exceptions.
@javiercn javiercn force-pushed the javiercn/identity-ui-scripts-fix branch from 3443753 to 52de81c Compare September 3, 2019 13:58
@Eilon Eilon added the area-identity Includes: Identity and providers label Sep 3, 2019
@javiercn javiercn requested a review from pranavkm September 4, 2019 16:50
}
finally
{
await Task.Delay(_waitIntervalBeforeRetry);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this use the CancellationToken?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll change it.

}
else
{
_output.WriteLine($"Request '{method} - {url}' failed with {result.StatusCode}.");
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it useful to include the message body here? If the app has the developer exception page set up, it should have the exception stack trace in plain text.

Copy link
Member Author

Choose a reason for hiding this comment

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

The error that I've seen here is a network connection/failure to resolve a host. I'm actually going to add an extra attempt at the end so that the error gets surfaced.

@javiercn javiercn merged commit 3368ea6 into release/3.1 Sep 4, 2019
@javiercn javiercn deleted the javiercn/identity-ui-scripts-fix branch September 4, 2019 20:09
dougbu added a commit that referenced this pull request Apr 8, 2021
- based on  @javiercn's 3368ea6 / #13646 fix
- avoid `TimeSpan` arithmetic and did not match refactoring done in 'release/3.1'
    - c# 8.0 is not supported in this branch
dougbu added a commit that referenced this pull request Apr 9, 2021
* Update branding to 2.1.28

* Bump `$(MicrosoftNETCoreAppPackageVersion)`
  - version flows into `$(MicrosoftNETCoreApp21PackageVersion)` automatically
  - cherry-picked from #30729 internal branch

* Get tests and archives working after rebranding
  - skip `SharedFxTests.BaselineTest(...)` between rebranding and baseline updates
    - previous runtime is not available in this window
  - reduce retries in `RetryHelper`
    - download will usually fail repeatedly if it fails even once
    - previous maximum duration (105 min.) was greater than the job timeout
  - avoid NETSDK1023 warnings
    - eng/targets/CSharp.Common.props adds packages removed from project
  - create archives based on one that actually exists between rebranding and baseline updates
  - mostly cherry-picked from #30729 internal branch

  nit: remove unused `GetTotalRetriesUsed()` method

* Use Ubuntu 18.04 build agents
  - set locale consistently on all platforms
    - default locale on newer agents is unloved `C.UTF-8`

* Stop using Ubuntu 14.04
  - run `locale-gen` to avoid "setlocale: LC_ALL: cannot change locale" and similar
    - needs `locales` package
  - move to still-supported Ubuntu 18.04 image
    - image needs slightly-newer `libicu60`, `clang` and `lldb` packages
    - rename Dockerfile to match
  - cherry-picked from #30729 internal branch for Ubuntu image update

  nit: set locale-related environment variables to match Python default

* Avoid KoreBuild issues when using dockerbuild.sh
  - avoid MSB4011 warnings (about repeated Directory.Build.targets imports)
    - place `$DOTNET_HOME` beside repo root, not under it
  - cherry-picked from #30729 internal branch for image update

  nits:
  - use current Docker image for 2.1 alpine
  - set `$LANGUAGE` with other locale-related environment variables

* Remove obsolete Groovy code

* Pick up latest EF sources
  - minor change shouldn't affect submodule build but best to keep up

* Improve the CDN tests
  - apply efe9b95 to similar template test
  - add debug output to CDN tests
  - back-port test reliability fix
    - based on  @javiercn's 3368ea6 / #13646 fix
    - avoid `TimeSpan` arithmetic and did not match refactoring done in 'release/3.1'
      - do not have recently-added `TimeSpan` operators in 2.1
  - skip `CdnScriptTaghelperTests` on .NET Framework
    - failures appear specific to that platform
    - leave src/Templating/test/Templates.Test/CdnScriptTagTests.cs unchanged
      - test project does not target .NET Framework
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-identity Includes: Identity and providers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants