0

I am using NorthscaleClient from Enyim Memcached client libary to store objects in Northscale Memcached Server. Below does not work consistently, assertion fails most of the time. Am I doing anything wrong?

        // File size is 360kb
        var reader = File.ReadAllText(@"c:\RHDSetup.log");
        for (int i = 0; i < 10; i++)
        {
            Assert.True(new NorthScaleClient(c).Store(StoreMode.Set, i.ToString(),
                                reader));

            Thread.Sleep(1000);
        }
asyncwait
  • 4,457
  • 4
  • 40
  • 53

1 Answers1

0

The problem was the usage of new NorthScaleClient(c).Store(StoreMode.Set, i.ToString(), reader) inside Assert.True method. After removing inline call and initializing it outside works well. I guess, it is probably sometimes the object goes out of scope and assertion fails.

asyncwait
  • 4,457
  • 4
  • 40
  • 53