-ํ
\&=c       si    d  Z    d k Z d k Z d k Z d k Z  d k Z  d k Z  d k l Z  d k	 Z	  d k
 Z
  d k Z  d k Z  d k Z  d Z  d Z  d Z  d Z   d Z ! d Z # d e i f d	     YZ , d
 e i f d     YZ 4 d   Z A d   Z F e d  Z X d   Z  e d  Z  e d j o  e   n d S(   s-   A multi-client test of the ZEO storage serverN(   s   forkeri   i   id   f0.10000000000000001s    s   Recordc      s)   # t  Z $ e e d  Z ) d   Z RS(   Nc    s+   $ % | |  _  & t |  _ ' t |  _ d  S(   N(   s   clients   selfs   Nones   values   next(   s   selfs   clients   value(    (    s7   /usr/pkg/lib/python2.2/site-packages/ZEO/tests/multi.pys   __init__$ s   c    s   ) * | |  _  d  S(   N(   s   nexts   self(   s   selfs   next(    (    s7   /usr/pkg/lib/python2.2/site-packages/ZEO/tests/multi.pys   set_next) s   (   s   __name__s
   __module__s   Nones   __init__s   set_next(    (    (    s7   /usr/pkg/lib/python2.2/site-packages/ZEO/tests/multi.pys   Record# s   	s   Statsc      s#   , t  Z - d   Z 1 d   Z RS(   Nc    s%   - . t  i    |  _ / t |  _ d  S(   N(   s   times   selfs   begins   Nones   end(   s   self(    (    s7   /usr/pkg/lib/python2.2/site-packages/ZEO/tests/multi.pys   __init__- s   c    s   1 2 t  i    |  _ d  S(   N(   s   times   selfs   end(   s   self(    (    s7   /usr/pkg/lib/python2.2/site-packages/ZEO/tests/multi.pys   done1 s   (   s   __name__s
   __module__s   __init__s   done(    (    (    s7   /usr/pkg/lib/python2.2/site-packages/ZEO/tests/multi.pys   Stats, s   	c     s   4 5 t  i   } 6 t o 7 d G| GHn 8 t i i |  } : t i |  } ; | i	   i
   }  < t i   |  d <= t   i   ? | Sd  S(   Ns   FileStorage path:s   multi(   s   tempfiles   mktemps   paths   VERBOSEs   ZODBs   FileStorages   fss   DBs   dbs   opens   roots   PersistentMappings   get_transactions   commit(   s   roots   paths   dbs   fs(    (    s7   /usr/pkg/lib/python2.2/site-packages/ZEO/tests/multi.pys   init_storage4 s   
c    s;   A B t    } C t i | |   \ } } D | | f Sd  S(   N(   s   init_storages   storages   forkers   start_zeo_servers   addrs   pids   exit(   s   addrs   exits   storages   pid(    (    s7   /usr/pkg/lib/python2.2/site-packages/ZEO/tests/multi.pys   start_serverA s   c    sั   F G t  i   } H | d j oค I z J d  k } K t o L d Gt  i   GHn M | i i |  d t	 } N | t j o O t |  n Q | |  R | i   Wd  S T t  i d  Xn V | Sd  S(   Ni    s   Client process started:s   client(   s   oss   forks   pids   ZEO.ClientStorages   ZEOs   VERBOSEs   getpids   ClientStorages   addrs   CLIENT_CACHEs   clis   client_funcs   Nones   runs   closes   _exit(   s   addrs   client_funcs   pids   ZEOs   cli(    (    s7   /usr/pkg/lib/python2.2/site-packages/ZEO/tests/multi.pys   start_clientF s   
c    sc  X Y t  |  d  o0 Z x& Z |  i   o [ t i t  q Wn \ t i   } ] d G| G|  GH^ t	 i
 |   } _ | i   i   } ` x} ` d or a y( b t   } | | <c t   i   Wn< d t	 i i j
 o' e t   i   f t i t  n Xh Pq Wj | d }	 k t }
 l d } m xm | t j  o๑ n y[ o t |	  } p t | |  } |	 | <q |
 o r |
 i |  n s t   i   Wn> t t	 i i j
 o) } u t   i   v t i t  nP Xx | d } y t! o | d j  p | d d j o z d | | t f GHn q4W{ | i"   | t   i   ~ d	 G| GHd  S(
   Ns   is_connecteds   Client process connected:i   s   multii    i   i
   s   Client %s: %s of %ss   Client completed:(#   s   hasattrs   storages   is_connecteds   times   sleeps   CONNECT_DELAYs   oss   getpids   pids   ZODBs   DBs   dbs   opens   roots   Statss   ss   get_transactions   commits   POSExceptions   ConflictErrors   aborts   CONFLICT_DELAYs   dicts   Nones   prevs   is   RECORDS_PER_CLIENTs   lens   sizes   Records   rs   set_nexts   errs   VERBOSEs   done(   s   storages   dbs   pids   rs   sizes   errs   is   roots   ss   dicts   prev(    (    s7   /usr/pkg/lib/python2.2/site-packages/ZEO/tests/multi.pys   runX sJ     
			 
(c    sฮ    t  o  d Gt i   GHn  t i   }  t i   }  t |  \ } }  t i   }	  g  }  x0 t t  D ] }
  | i t | |    q~ W xม | D ]ถ }  t o6 t |  t i j p  t d t |  t |  f   y7  t  o  d t |  GHn  t i | d  Wn3  t i j
 o! }  d t |  | f GHn Xqฎ W t i   }  | i    t i | d   d G| | GH d G|	 | GH d G| |	 GHd  S(	   Ns   Main process:s   invalid pid type: %s (%s)s   waitpid(%s)i    s   waitpid(%s) failed: %ss   Total time:s   Server start times   Client time:(   s   VERBOSEs   oss   getpids   tempfiles   mktemps   addrs   times   t0s   start_servers
   server_pids   servers   t1s   pidss   ranges   CLIENTSs   is   appends   start_clients   client_funcs   pids	   __debug__s   types   typess   IntTypes   AssertionErrors   reprs   waitpids   errors   errs   t2s   close(   s   client_funcs   pids
   server_pids   pidss   servers   addrs   errs   t2s   t0s   t1s   i(    (    s7   /usr/pkg/lib/python2.2/site-packages/ZEO/tests/multi.pys   main s2   
	 	
 	@
!s   __main__(   s   __doc__s   ZODBs   ZODB.DBs   ZODB.FileStorages   ZODB.POSExceptions   Persistences   PersistentMappings	   ZEO.testss   forkers   asyncores   oss   tempfiles   times   typess   VERBOSEs   CLIENTSs   RECORDS_PER_CLIENTs   CONFLICT_DELAYs   CONNECT_DELAYs   CLIENT_CACHEs
   Persistents   Records   Statss   init_storages   start_servers   Nones   start_clients   runs   mains   __name__(   s   CLIENT_CACHEs   asyncores   RECORDS_PER_CLIENTs   Statss   CLIENTSs   CONFLICT_DELAYs   forkers   Records   ZODBs   PersistentMappings   runs   Persistences   VERBOSEs   start_servers   tempfiles   start_clients   CONNECT_DELAYs   typess   times   init_storages   mains   os(    (    s7   /usr/pkg/lib/python2.2/site-packages/ZEO/tests/multi.pys   ? s0   '							(