ZeroInstall.Store.ConfigTest.StressTest C# (CSharp) Method

StressTest() private method

private StressTest ( ) : void
return void
        public void StressTest()
        {
            using (new LocationsRedirect("0install-unit-tests"))
            {
                new Config().Save();

                Exception exception = null;
                var threads = new Thread[100];
                for (int i = 0; i < threads.Length; i++)
                {
                    threads[i] = new Thread(() =>
                    {
                        try
                        {
                            Config.Load();
                        }
                        catch (Exception ex)
                        {
                            exception = ex;
                        }
                    });
                    threads[i].Start();
                }

                foreach (var thread in threads)
                    thread.Join();
                if (exception != null)
                    Assert.Fail(exception.ToString());
            }
        }
    }