Ejemplo n.º 1
0
        public virtual void TestAddIndexesWithRollback()
        {
            int NUM_COPY = TEST_NIGHTLY ? 50 : 5;
            CommitAndAddIndexes3 c = new CommitAndAddIndexes3(this, NUM_COPY);
            c.LaunchThreads(-1);

            Thread.Sleep(TestUtil.NextInt(Random(), 10, 500));

            // Close w/o first stopping/joining the threads
            if (VERBOSE)
            {
                Console.WriteLine("TEST: now force rollback");
            }
            c.DidClose = true;
            c.Writer2.Rollback();

            c.JoinThreads();

            c.CloseDir();

            Assert.IsTrue(c.Failures.Count == 0);
        }
Ejemplo n.º 2
0
        public virtual void TestAddIndexesWithCloseNoWait()
        {
            const int NUM_COPY = 50;
            CommitAndAddIndexes3 c = new CommitAndAddIndexes3(this, NUM_COPY);
            c.LaunchThreads(-1);

            Thread.Sleep(TestUtil.NextInt(Random(), 10, 500));

            // Close w/o first stopping/joining the threads
            if (VERBOSE)
            {
                Console.WriteLine("TEST: now close(false)");
            }
            c.Close(false);

            c.JoinThreads();

            if (VERBOSE)
            {
                Console.WriteLine("TEST: done join threads");
            }
            c.CloseDir();

            Assert.IsTrue(c.Failures.Count == 0);
        }
Ejemplo n.º 3
0
		public virtual void  TestAddIndexesWithRollback()
		{
			
			int NUM_COPY = 50;
			CommitAndAddIndexes3 c = new CommitAndAddIndexes3(this, NUM_COPY);
			c.LaunchThreads(- 1);
			
			System.Threading.Thread.Sleep(new System.TimeSpan((System.Int64) 10000 * 500));
			
			// Close w/o first stopping/joining the threads
			c.didClose = true;
			c.writer2.Rollback();
			
			c.JoinThreads();
			
			_TestUtil.CheckIndex(c.dir2);
			
			c.CloseDir();
			
			Assert.IsTrue(c.failures.Count == 0);
		}