예제 #1
0
def tconf(tconf):
    with freshness(tconf,
                   enabled=True,
                   timeout=STATE_FRESHNESS_UPDATE_INTERVAL):
        old_intervals_count = tconf.ACCEPTABLE_FRESHNESS_INTERVALS_COUNT
        tconf.ACCEPTABLE_FRESHNESS_INTERVALS_COUNT = ACCEPTABLE_FRESHNESS_INTERVALS_COUNT
        yield tconf
        tconf.ACCEPTABLE_FRESHNESS_INTERVALS_COUNT = old_intervals_count
def test_no_freshness_pre_prepare_when_disabled(tconf, primary_replica):
    with freshness(tconf, enabled=False, timeout=FRESHNESS_TIMEOUT):
        assert len(primary_replica.outBox) == 0

        primary_replica.send_3pc_batch()
        assert len(primary_replica.outBox) == 0

        set_current_time(primary_replica, FRESHNESS_TIMEOUT + 1)
        primary_replica.send_3pc_batch()
        assert len(primary_replica.outBox) == 0
예제 #3
0
def tconf(tconf):
    with freshness(tconf, enabled=True, timeout=FRESHNESS_TIMEOUT):
        yield tconf
예제 #4
0
def tconf(tconf):
    with freshness(tconf, enabled=True,
                   timeout=FRESHNESS_TIMEOUT), primary_disconnection_time(
                       tconf, 100):
        yield tconf