Skip to content

test(fast_io): IOCP high-concurrency stress 10K+ writes (#1871) - #4249

Merged
oferchen merged 1 commit into
masterfrom
test/iocp-high-concurrency-stress-1871
May 17, 2026
Merged

oferchen merged 1 commit into
masterfrom
test/iocp-high-concurrency-stress-1871

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • Adds crates/fast_io/tests/iocp_high_concurrency_stress.rs, cfg-gated to windows + iocp so it compiles to nothing on Linux and macOS.
  • Two opt-in scenarios stress the IOCP submission and completion machinery under workloads well past normal CI but safely under the 16,384 default per-process handle cap.
  • Runs are gated behind OC_RSYNC_IOCP_STRESS=1. Without the env var the tests print a skip message and return, so default cargo nextest stays fast.

Scenarios

  • stress_10k_small_writes_distinct_files: opens 10,000 distinct files in a tempdir and writes a 4 KB payload to each through a single IocpDiskBatch with concurrent_ops = 64. Asserts per-file byte counter, on-disk size, and total file count.
  • stress_10k_alternating_files_via_iocp_writer: keeps 10 IocpWriter handles alive and drives 1,000 write_all(4 KB) calls per file in round-robin order from a single thread. Asserts per-file size and a content checksum (in-test FNV-1a, no new dev-deps).

Test plan

  • On a Windows host: OC_RSYNC_IOCP_STRESS=1 cargo nextest run -p fast_io --features iocp -E 'test(stress_)' passes, both files land at the expected size, and no handle/sharing errors surface.
  • On Linux and macOS CI: the test file is cfg-gated and contributes no code; the default cargo nextest run -p fast_io run on Windows skips both tests with the expected eprintln! message.

Add cfg-gated stress coverage for the Windows IOCP disk path. Two
opt-in scenarios drive the submission/completion machinery well past
typical CI workloads while staying under the 16,384 per-process handle
cap:

- stress_10k_small_writes_distinct_files: opens 10,000 distinct files
  in a tempdir and writes a 4 KB payload to each through a single
  IocpDiskBatch with concurrent_ops = 64. Verifies per-file byte
  counter, on-disk size, and file count.
- stress_10k_alternating_files_via_iocp_writer: keeps 10 IocpWriter
  handles alive and drives 1,000 write_all(4 KB) calls per file in
  round-robin order from a single thread. Verifies per-file size and
  content checksum (in-test FNV-1a, no new dev-deps).

Both tests skip with a clear eprintln! unless OC_RSYNC_IOCP_STRESS=1
is set, so the default cargo nextest path stays fast. The file is
cfg-gated to windows + iocp and compiles to nothing elsewhere.
@oferchen
oferchen merged commit 1d1150f into master May 17, 2026
13 checks passed
@github-actions github-actions Bot added the test label May 17, 2026
oferchen added a commit that referenced this pull request May 18, 2026
Add cfg-gated stress coverage for the Windows IOCP disk path. Two
opt-in scenarios drive the submission/completion machinery well past
typical CI workloads while staying under the 16,384 per-process handle
cap:

- stress_10k_small_writes_distinct_files: opens 10,000 distinct files
  in a tempdir and writes a 4 KB payload to each through a single
  IocpDiskBatch with concurrent_ops = 64. Verifies per-file byte
  counter, on-disk size, and file count.
- stress_10k_alternating_files_via_iocp_writer: keeps 10 IocpWriter
  handles alive and drives 1,000 write_all(4 KB) calls per file in
  round-robin order from a single thread. Verifies per-file size and
  content checksum (in-test FNV-1a, no new dev-deps).

Both tests skip with a clear eprintln! unless OC_RSYNC_IOCP_STRESS=1
is set, so the default cargo nextest path stays fast. The file is
cfg-gated to windows + iocp and compiles to nothing elsewhere.
oferchen added a commit that referenced this pull request May 18, 2026
Add cfg-gated stress coverage for the Windows IOCP disk path. Two
opt-in scenarios drive the submission/completion machinery well past
typical CI workloads while staying under the 16,384 per-process handle
cap:

- stress_10k_small_writes_distinct_files: opens 10,000 distinct files
  in a tempdir and writes a 4 KB payload to each through a single
  IocpDiskBatch with concurrent_ops = 64. Verifies per-file byte
  counter, on-disk size, and file count.
- stress_10k_alternating_files_via_iocp_writer: keeps 10 IocpWriter
  handles alive and drives 1,000 write_all(4 KB) calls per file in
  round-robin order from a single thread. Verifies per-file size and
  content checksum (in-test FNV-1a, no new dev-deps).

Both tests skip with a clear eprintln! unless OC_RSYNC_IOCP_STRESS=1
is set, so the default cargo nextest path stays fast. The file is
cfg-gated to windows + iocp and compiles to nothing elsewhere.
@oferchen
oferchen deleted the test/iocp-high-concurrency-stress-1871 branch May 19, 2026 19:27
oferchen added a commit that referenced this pull request Aug 24, 2026
Add cfg-gated stress coverage for the Windows IOCP disk path. Two
opt-in scenarios drive the submission/completion machinery well past
typical CI workloads while staying under the 16,384 per-process handle
cap:

- stress_10k_small_writes_distinct_files: opens 10,000 distinct files
  in a tempdir and writes a 4 KB payload to each through a single
  IocpDiskBatch with concurrent_ops = 64. Verifies per-file byte
  counter, on-disk size, and file count.
- stress_10k_alternating_files_via_iocp_writer: keeps 10 IocpWriter
  handles alive and drives 1,000 write_all(4 KB) calls per file in
  round-robin order from a single thread. Verifies per-file size and
  content checksum (in-test FNV-1a, no new dev-deps).

Both tests skip with a clear eprintln! unless OC_RSYNC_IOCP_STRESS=1
is set, so the default cargo nextest path stays fast. The file is
cfg-gated to windows + iocp and compiles to nothing elsewhere.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant