Menu

#3 Nullreference in unittest

v1.0 (example)
open
nobody
5
2007-08-09
2007-08-09
No

I have altered Unittests.cs to use nunit(version 2.4.1). When i run a local memcache version (win32 1.2.0) and when I repeat the unittest serveral times i get a nullreference in test1 and sometimes in test11.

When i run memcached with -vv i do not see a store action in the debug log. So either there is a problem with expiration of with the socket because no connection is made.

I am using the latest svn version of memcacheddotnet.

Discussion

  • C.C.H. Weinberg

    C.C.H. Weinberg - 2007-08-09

    UnitTests.cs

     
  • C.C.H. Weinberg

    C.C.H. Weinberg - 2007-08-09

    Logged In: YES
    user_id=715108
    Originator: YES

    I further examined the error and with logging I got the following:
    System.IO.IOException: Could not connect for 50 milliseconds
    bij Memcached.ClientLibrary.SockIO.GetSocket(String host, Int32 port, Int32 timeout) in C:\Projects\DotNet\Memcached\Memcacheddotnet\trunk\clientlib\src\clientlib\SockIO.cs:regel 163
    bij Memcached.ClientLibrary.SockIO..ctor(SockIOPool pool, String host, Int32 timeout, Int32 connectTimeout, Boolean noDelay) in C:\Projects\DotNet\Memcached\Memcacheddotnet\trunk\clientlib\src\clientlib\SockIO.cs:regel 105
    bij Memcached.ClientLibrary.SockIOPool.CreateSocket(String host) in C:\Projects\DotNet\Memcached\Memcacheddotnet\trunk\clientlib\src\clientlib\SockIOPool.cs:regel 562
    2007-08-09 18:56:40,410 [1] ERROR Memcached.ClientLibrary.SockIOPool [(null)] - Failed to create connection to: 127.0.0.1:11211 -- only 0 created

    the socket that is returned on line 611 of MemCachedClient to be null and so no first insert is done and that is why the test fails.

    When i increase the pool.SocketConnectTimeout to more than 50 ms the error does not occur anymore. Maybe it would be better to increase the default
    value of 50ms.

     

Log in to post a comment.