Skip to content

TestCluster: wait for cluster stabilization before starting tests#4343

Merged
sergeybykov merged 4 commits intodotnet:masterfrom
ReubenBond:test-wait-for-stabilization
Apr 5, 2018
Merged

TestCluster: wait for cluster stabilization before starting tests#4343
sergeybykov merged 4 commits intodotnet:masterfrom
ReubenBond:test-wait-for-stabilization

Conversation

@ReubenBond
Copy link
Copy Markdown
Member

This PR adds a check in TestCluster to verify that each silo has observed the expected number of active silos

@ReubenBond
Copy link
Copy Markdown
Member Author

@dotnet-bot test this please

@xiazen
Copy link
Copy Markdown
Contributor

xiazen commented Mar 29, 2018

  • System.InvalidOperationException : Cannot find generated GrainReference class for interface 'Orleans.Runtime.TestHooks.ITestHooksSystemTarget'\r\n--
    seems like a valid test failure


if (totalWait.Elapsed < TimeSpan.FromSeconds(60))
{
WriteLog($"Warning! {remainingSilos} silos do not have a consistent cluster view after {totalWait.ElapsedMilliseconds}ms, continuing without stabilization.");
Copy link
Copy Markdown
Contributor

@xiazen xiazen Mar 29, 2018

Choose a reason for hiding this comment

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

I think you may miss a break here. If while loop runs longer than a certain time, then break from the loop?

// Poll each silo to check that it knows the expected number of active silos.
// If any silo does not have the expected number of active silos in its cluster membership oracle, try again.
// If the cluster membership has not stabilized after a certain period of time, give up and continue anyway.
var totalWait = Stopwatch.StartNew();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can you capsulate this section of code into a function WaitForClusterStabilizing or MakeSureAllSiloJoinedCluster method. Just to make it cleaner and more readable

@sergeybykov
Copy link
Copy Markdown
Contributor

Two tests are failing consistently:

UnitTests.RuntimeCodeGenTests.RuntimeCodeGen_BasicEndToEnd

MESSAGE:
System.AggregateException : One or more errors occurred.\r\n---- System.InvalidOperationException : Cannot find generated GrainReference class for interface 'Orleans.Runtime.TestHooks.ITestHooksSystemTarget'\r\n---- The following constructor parameters did not have matching fixture data: Fixture fixture
+++++++++++++++++++
STACK TRACE:
----- Inner Stack Trace #1 (System.InvalidOperationException) ----- at Orleans.Runtime.TypeMetadataCache.GetGrainReferenceType(Type interfaceType) in D:\j\workspace\functional_pr---83d31c72\src\Orleans.Core\AssemblyLoader\TypeMetadataCache.cs:line 53 at Orleans.GrainFactory.MakeCaster(Type interfaceType) in D:\j\workspace\functional_pr---83d31c72\src\Orleans.Core\Core\GrainFactory.cs:line 252 at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory) at Orleans.GrainFactory.Cast(IAddressable grain, Type interfaceType) in D:\j\workspace\functional_pr---83d31c72\src\Orleans.Core\Core\GrainFactory.cs:line 239 at Orleans.GrainFactory.Cast[TGrainInterface](IAddressable grain) in D:\j\workspace\functional_pr---83d31c72\src\Orleans.Core\Core\GrainFactory.cs:line 223 at Orleans.GrainFactory.GetSystemTarget[TGrainInterface](GrainId grainId, SiloAddress destination) in D:\j\workspace\functional_pr---83d31c72\src\Orleans.Core\Core\GrainFactory.cs:line 286 at Orleans.TestingHost.TestCluster.d__36.MoveNext() in D:\j\workspace\functional_pr---83d31c72\src\Orleans.TestingHost\TestCluster.cs:line 205 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Orleans.TestingHost.TestCluster.Deploy() in D:\j\workspace\functional_pr---83d31c72\src\Orleans.TestingHost\TestCluster.cs:line 126 at TestExtensions.BaseTestClusterFixture..ctor() in D:\j\workspace\functional_pr---83d31c72\test\TestExtensions\BaseClusterFixture.cs:line 43 ----- Inner Stack Trace #2 (Xunit.Sdk.TestClassException) -----

UnitTests.RuntimeCodeGenTests.RuntimeCodeGen_AddsSupportClasses

System.AggregateException : One or more errors occurred.\r\n---- System.InvalidOperationException : Cannot find generated GrainReference class for interface 'Orleans.Runtime.TestHooks.ITestHooksSystemTarget'\r\n---- The following constructor parameters did not have matching fixture data: Fixture fixture
+++++++++++++++++++
STACK TRACE:
----- Inner Stack Trace #1 (System.InvalidOperationException) ----- at Orleans.Runtime.TypeMetadataCache.GetGrainReferenceType(Type interfaceType) in D:\j\workspace\functional_pr---83d31c72\src\Orleans.Core\AssemblyLoader\TypeMetadataCache.cs:line 53 at Orleans.GrainFactory.MakeCaster(Type interfaceType) in D:\j\workspace\functional_pr---83d31c72\src\Orleans.Core\Core\GrainFactory.cs:line 252 at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory) at Orleans.GrainFactory.Cast(IAddressable grain, Type interfaceType) in D:\j\workspace\functional_pr---83d31c72\src\Orleans.Core\Core\GrainFactory.cs:line 239 at Orleans.GrainFactory.Cast[TGrainInterface](IAddressable grain) in D:\j\workspace\functional_pr---83d31c72\src\Orleans.Core\Core\GrainFactory.cs:line 223 at Orleans.GrainFactory.GetSystemTarget[TGrainInterface](GrainId grainId, SiloAddress destination) in D:\j\workspace\functional_pr---83d31c72\src\Orleans.Core\Core\GrainFactory.cs:line 286 at Orleans.TestingHost.TestCluster.d__36.MoveNext() in D:\j\workspace\functional_pr---83d31c72\src\Orleans.TestingHost\TestCluster.cs:line 205 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Orleans.TestingHost.TestCluster.Deploy() in D:\j\workspace\functional_pr---83d31c72\src\Orleans.TestingHost\TestCluster.cs:line 126 at TestExtensions.BaseTestClusterFixture..ctor() in D:\j\workspace\functional_pr---83d31c72\test\TestExtensions\BaseClusterFixture.cs:line 43 ----- Inner Stack Trace #2 (Xunit.Sdk.TestClassException) -----

@ReubenBond
Copy link
Copy Markdown
Member Author

@dotnet-bot test bvt

We see this deps.json failure sometimes

@sergeybykov sergeybykov merged commit 868926f into dotnet:master Apr 5, 2018
@ReubenBond ReubenBond deleted the test-wait-for-stabilization branch April 5, 2018 21:01
sergeybykov pushed a commit to sergeybykov/orleans that referenced this pull request May 5, 2018
@github-actions github-actions bot locked and limited conversation to collaborators Dec 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants