clawhdf5-remote tests: open + list and a dataset read counted apart
The per-file report now separates a tree view (open, every group's entries, every dataset's shape and type) from reading the largest dataset under 64 MiB, and checks the budget the design's testing section asks for: listing the IMERG file (file A of docs/design/range-reads.md section 2) takes at most 3 requests when CLAWHDF5_REMOTE_CORPUS includes it. The test server now counts a response's bytes before sending it: a client could read a body and reset the counters before the server thread had added it, so the counts of the next file were occasionally too high. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
@@ -320,9 +320,11 @@ fn serve(conn: TcpStream, s: &Shared) -> std::io::Result<()> {
|
||||
};
|
||||
let mut response = head.into_bytes();
|
||||
response.extend_from_slice(body);
|
||||
// Counted before the client can have the bytes, so a test that
|
||||
// resets the counters after a read never sees them arrive late.
|
||||
s.bytes.fetch_add(body.len() as u64, Ordering::SeqCst);
|
||||
out.write_all(&response)?;
|
||||
out.flush()?;
|
||||
s.bytes.fetch_add(body.len() as u64, Ordering::SeqCst);
|
||||
if truncate || close {
|
||||
let _ = out.shutdown(std::net::Shutdown::Both);
|
||||
return Ok(());
|
||||
|
||||
Reference in New Issue
Block a user