/// <exception cref="System.Exception"/>
        public virtual void TestPeriodic()
        {
            Configuration conf = new Configuration();

            conf.Set("ns." + DecayRpcScheduler.IpcCallqueueDecayschedulerPeriodKey, "10");
            conf.Set("ns." + DecayRpcScheduler.IpcCallqueueDecayschedulerFactorKey, "0.5");
            scheduler = new DecayRpcScheduler(1, "ns", conf);
            Assert.Equal(10, scheduler.GetDecayPeriodMillis());
            Assert.Equal(0, scheduler.GetTotalCallSnapshot());
            for (int i = 0; i < 64; i++)
            {
                scheduler.GetPriorityLevel(MockCall("A"));
            }
            // It should eventually decay to zero
            while (scheduler.GetTotalCallSnapshot() > 0)
            {
                Thread.Sleep(10);
            }
        }
        public virtual void TestDecay()
        {
            Configuration conf = new Configuration();

            conf.Set("ns." + DecayRpcScheduler.IpcCallqueueDecayschedulerPeriodKey, "999999999"
                     );
            // Never
            conf.Set("ns." + DecayRpcScheduler.IpcCallqueueDecayschedulerFactorKey, "0.5");
            scheduler = new DecayRpcScheduler(1, "ns", conf);
            Assert.Equal(0, scheduler.GetTotalCallSnapshot());
            for (int i = 0; i < 4; i++)
            {
                scheduler.GetPriorityLevel(MockCall("A"));
            }
            for (int i_1 = 0; i_1 < 8; i_1++)
            {
                scheduler.GetPriorityLevel(MockCall("B"));
            }
            Assert.Equal(12, scheduler.GetTotalCallSnapshot());
            Assert.Equal(4, scheduler.GetCallCountSnapshot()["A"]);
            Assert.Equal(8, scheduler.GetCallCountSnapshot()["B"]);
            scheduler.ForceDecay();
            Assert.Equal(6, scheduler.GetTotalCallSnapshot());
            Assert.Equal(2, scheduler.GetCallCountSnapshot()["A"]);
            Assert.Equal(4, scheduler.GetCallCountSnapshot()["B"]);
            scheduler.ForceDecay();
            Assert.Equal(3, scheduler.GetTotalCallSnapshot());
            Assert.Equal(1, scheduler.GetCallCountSnapshot()["A"]);
            Assert.Equal(2, scheduler.GetCallCountSnapshot()["B"]);
            scheduler.ForceDecay();
            Assert.Equal(1, scheduler.GetTotalCallSnapshot());
            Assert.Equal(null, scheduler.GetCallCountSnapshot()["A"]);
            Assert.Equal(1, scheduler.GetCallCountSnapshot()["B"]);
            scheduler.ForceDecay();
            Assert.Equal(0, scheduler.GetTotalCallSnapshot());
            Assert.Equal(null, scheduler.GetCallCountSnapshot()["A"]);
            Assert.Equal(null, scheduler.GetCallCountSnapshot()["B"]);
        }