diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-29 19:47:39 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:17 -0300 |
| commit | 290015c17de9348d10273cac1495950cc3e92d3a (patch) | |
| tree | be5e7789f8956d3413873efb25f11d26f735a1f9 /test | |
| parent | 0fd908eea63d04886b269438aa7529d3dd422256 (diff) | |
| download | pardes-290015c17de9348d10273cac1495950cc3e92d3a.tar.gz pardes-290015c17de9348d10273cac1495950cc3e92d3a.zip | |
The 9P monkey allows a look's misses to each Twrite that succeeded, not to none when one failed
A look line written a byte a Twrite is a look a byte, each its own write logging its own miss; when its last byte was a control character that one write failed, and the oracle dropped every miss allowance on the path, so seed 51 failed with 21 errs for 1 refused write. Allowances are now counted over the Twrites that succeeded (and an hwrite's only once it has).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'test')
| -rw-r--r-- | test/monkey9p.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/test/monkey9p.py b/test/monkey9p.py index c0e99fb8..ee0b0ebc 100644 --- a/test/monkey9p.py +++ b/test/monkey9p.py @@ -641,11 +641,11 @@ def op_write(sess, op): ok, body = w.call(TOPEN, struct.pack('<IB', fid, mode), timeout) res.add(open_kind(path, mode), path, ok, None if ok else body) sizes = chunking(op.get('chunks', 'whole'), len(data), w.msize - 23) - allowances(res, path, data, sizes, w.msize - 24) opened = ok sent = data if ok: offset = 0 + took = [] for size in sizes: piece = data[offset:offset + size] ok, body = w.call(TWRITE, struct.pack('<IQI', fid, op.get('offset', offset), len(piece)) + piece, timeout) @@ -654,8 +654,13 @@ def op_write(sess, op): res.add('write' if mode & 3 else 'write-badfid', path, ok, None if ok else body) offset += size sent = data[:offset] + if ok: + took.append(size) if not ok and op.get('stop_on_error', True): break + # Misses are allowed the Twrites that succeeded: a line written a + # byte a Twrite is a look a byte, each its own write. + allowances(res, path, data[:sum(took)], took, w.msize - 24) ok, body = w.call(TCLUNK, struct.pack('<I', fid), timeout) res.add('clunk-write' if mode & 3 else 'clunk', path, ok, None if ok else body) # What the open holds when it closes: the last line written, if unended. @@ -850,11 +855,12 @@ def op_hwrite(sess, op): fid, path, mode, off, _ = h data = dec(op['data'])[:sess.wire.msize - 23] # one Twrite h[4] = data - allowances(res, path, data, [len(data)], sess.wire.msize - 24) ok, body = sess.wire.call(TWRITE, struct.pack('<IQI', fid, off[0], len(data)) + data, SLOW_TIMEOUT if slow(data) else TIMEOUT) res.add('write' if mode & 3 else 'write-badfid', path, ok, None if ok else body) if ok: + allowances(res, path, data, [len(data)], sess.wire.msize - 24) + if ok: off[0] += len(data) return res @@ -1498,9 +1504,9 @@ def one_failure_rule(ctx, res): and w[1].rstrip('/') != '/pane/new'] errs = occurrences(res.window, 'err') msgs = occurrences(res.window, 'msg') - # Only for a write that succeeded: a failed one logs its one err. - failed_paths = {w[1] for w in failed} - allowed = sum(r[3] for r in res.requests if r[0] == 'allow' and r[1] not in failed_paths) + # Allowed only the Twrites that succeeded (allowances): a failed one + # logs its one err. + allowed = sum(r[3] for r in res.requests if r[0] == 'allow') # fs.md 'A write of command lines ... what is left when it closes runs at # the close ... and its failure is in the log alone'. closes = [r for r in res.requests if r[0] == 'close-runs'] |
