Example #1
0
        public ISiloBuilder CreateSiloBuilder(string siloName, ClusterConfiguration clusterConfiguration)
        {
            ISiloBuilder builder = new SiloBuilder();

            return(builder.ConfigureSiloName(siloName)
                   .UseConfiguration(clusterConfiguration)
                   .ConfigureLogging(loggingBuilder => TestingUtils.ConfigureDefaultLoggingBuilder(loggingBuilder,
                                                                                                   clusterConfiguration.GetOrCreateNodeConfigurationForSilo(siloName).TraceFileName)));
        }
Example #2
0
        public ISiloHostBuilder CreateSiloBuilder(string siloName, ClusterConfiguration clusterConfiguration)
        {
            var builder = new SiloHostBuilder();

            return(builder.ConfigureSiloName(siloName)
                   .ConfigureApplicationParts(parts => parts.AddFromAppDomain())
                   .UseConfiguration(clusterConfiguration)
                   .ConfigureLogging(loggingBuilder => TestingUtils.ConfigureDefaultLoggingBuilder(loggingBuilder,
                                                                                                   TestingUtils.CreateTraceFileName(siloName, clusterConfiguration.Globals.ClusterId))));
        }
Example #3
0
        /// <summary>
        /// Initialize the grain client. This should be already done by <see cref="Deploy()"/> or <see cref="DeployAsync"/>
        /// </summary>
        public void InitializeClient()
        {
            WriteLog("Initializing Grain Client");
            ClientConfiguration clientConfig = this.ClientConfiguration;

            if (Debugger.IsAttached)
            {
                // Test is running inside debugger - Make timeout ~= infinite
                clientConfig.ResponseTimeout = TimeSpan.FromMilliseconds(1000000);
            }

            this.InternalClient = (IInternalClusterClient) new ClientBuilder()
                                  .UseConfiguration(clientConfig)
                                  .ConfigureLogging(builder => TestingUtils.ConfigureDefaultLoggingBuilder(builder, clientConfig.TraceFileName)).Build();
            this.InternalClient.Connect().Wait();
            this.SerializationManager  = this.ServiceProvider.GetRequiredService <SerializationManager>();
            this.StreamProviderManager = this.ServiceProvider.GetRequiredService <IRuntimeClient>().CurrentStreamProviderManager;
        }