Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(28)  |  Call(20)  |  Derive(0)  |  Import(8)

src/c/o/concoord-1.1.0/concoord/test/test_timeout.py   concoord(Download)
import subprocess
import time
from concoord.proxy.counter import Counter
from concoord.exception import ConnectionError
 
def connect_to_leader():
    c_leader = Counter('127.0.0.1:14000')
    print "Connecting to old leader"
    for i in range(100):
        c_leader.increment()
 
    # This client can only connect to the replicas in this partition
    c_P1 = Counter('127.0.0.1:14000', debug = True)
    c_P2 = Counter('127.0.0.1:14001, 127.0.0.1:14002')
    # The client should work

src/c/o/concoord-HEAD/concoord/test/test_timeout.py   concoord(Download)
import subprocess
import time
from concoord.proxy.counter import Counter
from concoord.exception import ConnectionError
 
def connect_to_leader():
    c_leader = Counter('127.0.0.1:14000')
    print "Connecting to old leader"
    for i in range(100):
        c_leader.increment()
 
    # This client can only connect to the replicas in this partition
    c_P1 = Counter('127.0.0.1:14000', debug = True)
    c_P2 = Counter('127.0.0.1:14001, 127.0.0.1:14002')
    # The client should work

src/c/o/concoord-HEAD/concoord/test/test_replicacrashfailure.py   concoord(Download)
import subprocess
import time
from concoord.proxy.counter import Counter
 
class TimeoutException(Exception):
    replicastring = ','.join(replicanames)
    # Test Clientproxy operations
    c = Counter(replicastring)
    for i in range(100):
        c.increment()

src/c/o/concoord-HEAD/concoord/test/test_replicacomeback.py   concoord(Download)
import subprocess
import time
from concoord.proxy.counter import Counter
 
class TimeoutException(Exception):
    replicastring = ','.join(replicanames)
    # Test Clientproxy operations
    c = Counter(replicastring)
    for i in range(50):
        c.increment()
 
        # Clientproxy operations should still work
        c = Counter('127.0.0.1:1400%d'%(i+1))
        for i in range(50):
            c.increment()
        while(not connected):
            try:
                c = Counter('127.0.0.1:1400%d'%i)
            except:
                continue

src/c/o/concoord-HEAD/concoord/test/test_partition.py   concoord(Download)
import subprocess
from concoord.message import *
from concoord.proxy.counter import Counter
from concoord.exception import ConnectionError
 
def connect_to_minority():
    c_minority = Counter('127.0.0.1:14000')
    for i in range(50):
        c_minority.increment()
    # This method will timeout before it reaches here.
 
    # This client can only connect to the replicas in this partition
    c_P1 = Counter('127.0.0.1:14000')
    c_P2 = Counter('127.0.0.1:14001,127.0.0.1:14002')
    # The client should work

src/c/o/concoord-1.1.0/concoord/test/test_replicacrashfailure.py   concoord(Download)
import subprocess
import time
from concoord.proxy.counter import Counter
 
class TimeoutException(Exception):
    replicastring = ','.join(replicanames)
    # Test Clientproxy operations
    c = Counter(replicastring)
    for i in range(100):
        c.increment()

src/c/o/concoord-1.1.0/concoord/test/test_replicacomeback.py   concoord(Download)
import subprocess
import time
from concoord.proxy.counter import Counter
 
class TimeoutException(Exception):
    replicastring = ','.join(replicanames)
    # Test Clientproxy operations
    c = Counter(replicastring)
    for i in range(50):
        c.increment()
 
        # Clientproxy operations should still work
        c = Counter('127.0.0.1:1400%d'%(i+1))
        for i in range(50):
            c.increment()
        while(not connected):
            try:
                c = Counter('127.0.0.1:1400%d'%i)
            except:
                continue

src/c/o/concoord-1.1.0/concoord/test/test_partition.py   concoord(Download)
import subprocess
from concoord.message import *
from concoord.proxy.counter import Counter
from concoord.exception import ConnectionError
 
def connect_to_minority():
    c_minority = Counter('127.0.0.1:14000')
    for i in range(50):
        c_minority.increment()
    # This method will timeout before it reaches here.
 
    # This client can only connect to the replicas in this partition
    c_P1 = Counter('127.0.0.1:14000')
    c_P2 = Counter('127.0.0.1:14001,127.0.0.1:14002')
    # The client should work