Skip to content
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

CreateDefaultBuilder_SecretsDoesReload test failed in CI #48696

Closed
stephentoub opened this issue Feb 24, 2021 · 9 comments · Fixed by #51520
Closed

CreateDefaultBuilder_SecretsDoesReload test failed in CI #48696

stephentoub opened this issue Feb 24, 2021 · 9 comments · Fixed by #51520
Labels
area-Extensions-Hosting help wanted [up-for-grabs] Good issue for external contributors
Milestone

Comments

@stephentoub
Copy link
Member

https://helixre8s23ayyeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-48684-merge-1dda5503a115420687/Microsoft.Extensions.Hosting.Unit.Tests/console.b5b90d65.log?sv=2019-07-07&se=2021-03-16T05%3A35%3A14Z&sr=c&sp=rl&sig=ytXzgYX%2F6x0X9rBYl8sm%2B1JpNoEfEPjQFQhlMtH69tU%3D

  Discovering: Microsoft.Extensions.Hosting.Unit.Tests (method display = ClassAndMethod, method display options = None)
  Discovered:  Microsoft.Extensions.Hosting.Unit.Tests (found 99 test cases)
  Starting:    Microsoft.Extensions.Hosting.Unit.Tests (parallel test collections = on, max threads = 2)
�[40m�[32minfo�[39m�[22m�[49m: Microsoft.Extensions.Hosting.Tests.HostTests[0]
      Request starting
    Microsoft.Extensions.Hosting.Tests.HostTests.CreateDefaultBuilder_SecretsDoesReload [FAIL]
      Assert.Equal() Failure
                                    ↓ (pos 20)
      Expected: Hello ASP.NET Core: f577b280d3814d6c935970a1aadbb8e6
      Actual:   Hello ASP.NET Core: 407a83ef08c04e1ca1e07690cb30dc0a
                                    ↑ (pos 20)
      Stack Trace:
        /_/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/HostTests.cs(264,0): at Microsoft.Extensions.Hosting.Tests.HostTests.CreateDefaultBuilder_SecretsDoesReload()
        --- End of stack trace from previous location ---
  Finished:    Microsoft.Extensions.Hosting.Unit.Tests
@ghost
Copy link

ghost commented Feb 24, 2021

Tagging subscribers to this area: @eerhardt, @maryamariyan
See info in area-owners.md if you want to be subscribed.

Issue Details

https://helixre8s23ayyeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-48684-merge-1dda5503a115420687/Microsoft.Extensions.Hosting.Unit.Tests/console.b5b90d65.log?sv=2019-07-07&se=2021-03-16T05%3A35%3A14Z&sr=c&sp=rl&sig=ytXzgYX%2F6x0X9rBYl8sm%2B1JpNoEfEPjQFQhlMtH69tU%3D

  Discovering: Microsoft.Extensions.Hosting.Unit.Tests (method display = ClassAndMethod, method display options = None)
  Discovered:  Microsoft.Extensions.Hosting.Unit.Tests (found 99 test cases)
  Starting:    Microsoft.Extensions.Hosting.Unit.Tests (parallel test collections = on, max threads = 2)
�[40m�[32minfo�[39m�[22m�[49m: Microsoft.Extensions.Hosting.Tests.HostTests[0]
      Request starting
    Microsoft.Extensions.Hosting.Tests.HostTests.CreateDefaultBuilder_SecretsDoesReload [FAIL]
      Assert.Equal() Failure
                                    ↓ (pos 20)
      Expected: Hello ASP.NET Core: f577b280d3814d6c935970a1aadbb8e6
      Actual:   Hello ASP.NET Core: 407a83ef08c04e1ca1e07690cb30dc0a
                                    ↑ (pos 20)
      Stack Trace:
        /_/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/HostTests.cs(264,0): at Microsoft.Extensions.Hosting.Tests.HostTests.CreateDefaultBuilder_SecretsDoesReload()
        --- End of stack trace from previous location ---
  Finished:    Microsoft.Extensions.Hosting.Unit.Tests
Author: stephentoub
Assignees: -
Labels:

area-Extensions-Hosting

Milestone: -

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Feb 24, 2021
@ghost ghost added this to Untriaged in ML, Extensions, Globalization, etc, POD. Feb 24, 2021
@eerhardt
Copy link
Member

Looking at the test log, it looks like that test took 1 minute to run:

image

Looking at the test, it looks like it is waiting for 1 minute:

config.GetReloadToken().RegisterChangeCallback(o =>
{
configReloadedCancelTokenSource.Cancel();
}, null);
// Wait for up to 1 minute, if config reloads at any time, cancel the wait.
await Task.WhenAny(Task.Delay(TimeSpan.FromMinutes(1), configReloadedCancelToken)); // Task.WhenAny ignores the task throwing on cancellation.
Assert.NotEqual(dynamicConfigMessage1, dynamicConfigMessage2); // Messages are different.
Assert.Equal(dynamicConfigMessage2, config["Hello"]); // Config DID reload from disk

So this leads me to believe that the change callback was never invoked, which is why we are getting stale data in the config.

@maryamariyan maryamariyan removed the untriaged New issue has not been triaged by the area owner label Mar 1, 2021
@maryamariyan maryamariyan added this to the 6.0.0 milestone Mar 1, 2021
@ghost ghost moved this from Untriaged to 6.0.0 in ML, Extensions, Globalization, etc, POD. Mar 1, 2021
@maryamariyan maryamariyan self-assigned this Mar 1, 2021
@stephentoub
Copy link
Member Author

Failed again here:
https://dev.azure.com/dnceng/public/_build/results?buildId=1061100&view=ms.vss-test-web.build-test-results-tab&runId=32699320&paneView=attachments&resultId=181769
https://helixre8s23ayyeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-50357-merge-ede7a005545e42cf8b/Microsoft.Extensions.Hosting.Unit.Tests/console.39af16ec.log?sv=2019-07-07&se=2021-04-18T11%3A42%3A53Z&sr=c&sp=rl&sig=k%2BL7uF4zgHywaVYUegb2Pi%2F%2F7AIejrTog53v%2FftznF0%3D

  Discovering: Microsoft.Extensions.Hosting.Unit.Tests (method display = ClassAndMethod, method display options = None)
  Discovered:  Microsoft.Extensions.Hosting.Unit.Tests (found 100 test cases)
  Starting:    Microsoft.Extensions.Hosting.Unit.Tests (parallel test collections = on, max threads = 2)
    Microsoft.Extensions.Hosting.Tests.HostTests.CreateDefaultBuilder_SecretsDoesReload [FAIL]
      Assert.Equal() Failure
                                    ↓ (pos 20)
      Expected: Hello ASP.NET Core: 1466b2f4da5249bdaef71d3aeee50e47
      Actual:   Hello ASP.NET Core: 8ab58f24c0c34494a4a4969709dc8a26
                                    ↑ (pos 20)
      Stack Trace:
        /_/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/HostTests.cs(264,0): at Microsoft.Extensions.Hosting.Tests.HostTests.CreateDefaultBuilder_SecretsDoesReload()
        --- End of stack trace from previous location ---
�[40m�[32minfo�[39m�[22m�[49m: Microsoft.Extensions.Hosting.Tests.HostTests[0]
      Request starting
  Finished:    Microsoft.Extensions.Hosting.Unit.Tests

@safern safern added the blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' label Mar 31, 2021
@maryamariyan
Copy link
Member

The test was added in #43807

@maryamariyan
Copy link
Member

Removed blocking-clean-ci as the ActiveIssue attribute is now added to the test.

Keeping issue open to track re-enabling it properly

@maryamariyan maryamariyan added the help wanted [up-for-grabs] Good issue for external contributors label Apr 6, 2021
IEvangelist added a commit that referenced this issue Apr 19, 2021
There appeared to be two issues, where the config.GetReloadToken().RegisterChangeCallback was registered after the updates were made.
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Apr 19, 2021
ML, Extensions, Globalization, etc, POD. automation moved this from 6.0.0 to Done Apr 21, 2021
IEvangelist added a commit that referenced this issue Apr 21, 2021
There appeared to be two issues, where the config.GetReloadToken().RegisterChangeCallback was registered after the updates were made.
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Apr 21, 2021
@ViktorHofer
Copy link
Member

Happened again in https://dev.azure.com/dnceng/public/_build/results?buildId=1109669&view=ms.vss-test-web.build-test-results-tab&runId=33849264&resultId=182792&paneView=debug

  Discovering: Microsoft.Extensions.Hosting.Unit.Tests (method display = ClassAndMethod, method display options = None)
  Discovered:  Microsoft.Extensions.Hosting.Unit.Tests (found 108 of 109 test cases)
  Starting:    Microsoft.Extensions.Hosting.Unit.Tests (parallel test collections = on, max threads = 2)
    Microsoft.Extensions.Hosting.Tests.HostTests.CreateDefaultBuilder_SecretsDoesReload [FAIL]
      Assert.Equal() Failure
                                    ↓ (pos 20)
      Expected: Hello ASP.NET Core: fd88495f2f6f4395a50b8a8bb9002821
      Actual:   Hello ASP.NET Core: 96d471cc9668492aa1d5528c5d782693
                                    ↑ (pos 20)
      Stack Trace:
        /_/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/HostTests.cs(315,0): at Microsoft.Extensions.Hosting.Tests.HostTests.CreateDefaultBuilder_SecretsDoesReload()
        --- End of stack trace from previous location ---
�[40m�[32minfo�[39m�[22m�[49m: Microsoft.Extensions.Hosting.Tests.HostTests[0]
      Request starting
  Finished:    Microsoft.Extensions.Hosting.Unit.Tests

Configuration: net6.0-Linux-Debug-x64-CoreCLR_release-Ubuntu.1604.Amd64.Open

@ViktorHofer ViktorHofer reopened this Apr 27, 2021
@ViktorHofer
Copy link
Member

cc @IEvangelist

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label May 7, 2021
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Jun 7, 2021
@bartonjs
Copy link
Member

And again. https://dev.azure.com/dnceng/public/_build/results?buildId=1179018&view=ms.vss-test-web.build-test-results-tab&runId=35916356&resultId=117977&paneView=debug

/datadisks/disk1/work/C7C50B48/w/B068098D/e /datadisks/disk1/work/C7C50B48/w/B068098D/e
  Discovering: Microsoft.Extensions.Hosting.Unit.Tests (method display = ClassAndMethod, method display options = None)
  Discovered:  Microsoft.Extensions.Hosting.Unit.Tests (found 109 of 110 test cases)
  Starting:    Microsoft.Extensions.Hosting.Unit.Tests (parallel test collections = on, max threads = 2)
    Microsoft.Extensions.Hosting.Tests.HostTests.CreateDefaultBuilder_SecretsDoesReload [FAIL]
      Assert.Equal() Failure
                                    ↓ (pos 20)
      Expected: Hello ASP.NET Core: d05cbd4bd6cf4e89b5e5a16267814a60
      Actual:   Hello ASP.NET Core: 5d71a4fa37c348828f14c431f252b45e
                                    ↑ (pos 20)
      Stack Trace:
        /_/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/HostTests.cs(316,0): at Microsoft.Extensions.Hosting.Tests.HostTests.CreateDefaultBuilder_SecretsDoesReload()
        --- End of stack trace from previous location ---
�[40m�[32minfo�[39m�[22m�[49m: Microsoft.Extensions.Hosting.Tests.HostTests[0]
      Request starting
  Finished:    Microsoft.Extensions.Hosting.Unit.Tests
=== TEST EXECUTION SUMMARY ===
   Microsoft.Extensions.Hosting.Unit.Tests  Total: 115, Errors: 0, Failed: 1, Skipped: 0, Time: 3.639s

@eerhardt eerhardt modified the milestones: 6.0.0, 7.0.0 Jul 22, 2021
@ghost ghost moved this from 6.0.0 to Untriaged in ML, Extensions, Globalization, etc, POD. Jul 22, 2021
@maryamariyan maryamariyan moved this from Untriaged to 7.0.0 in ML, Extensions, Globalization, etc, POD. Aug 4, 2021
@maryamariyan maryamariyan removed their assignment Feb 27, 2022
@eerhardt
Copy link
Member

Closing as this hasn't failed in over a year. Please re-open if this happens again.

@ghost ghost locked as resolved and limited conversation to collaborators Aug 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Extensions-Hosting help wanted [up-for-grabs] Good issue for external contributors
Projects
None yet
6 participants