(stub, i, bytes)
| 229 | // path silenced the outbound loop and A never saw any of B's |
| 230 | // writes. |
| 231 | async function pushOneWrite(stub, i, bytes) { |
| 232 | const hash = new Uint8Array(await crypto.subtle.digest("SHA-256", bytes)); |
| 233 | await stub.sync.pushObjects( |
| 234 | new ReadableStream({ |
| 235 | start(c) { |
| 236 | c.enqueue({ hash, bytes }); |
| 237 | c.close(); |
| 238 | }, |
| 239 | }), |
| 240 | ); |
| 241 | await stub.sync.push({ |
| 242 | senderRev: 0, |
| 243 | changes: new ReadableStream({ |
| 244 | start(c) { |
| 245 | c.enqueue({ |
| 246 | kind: "file", |
| 247 | path: `/soak_${i}.bin`, |
| 248 | mode: 0o644, |
| 249 | mtime: Date.now(), |
| 250 | size: bytes.byteLength, |
| 251 | chunks: [{ hash, size: bytes.byteLength }], |
| 252 | }); |
| 253 | c.close(); |
| 254 | }, |
| 255 | }), |
| 256 | }); |
| 257 | } |
| 258 | |
| 259 | async function main() { |
| 260 | if (!DISABLE_FUSE) await ensureImage(); |
no test coverage detected