Skip to content

test(encryption): give the concurrent ReadAt timing test more headroom - #2640

Open
laskoviymishka wants to merge 1 commit into
apache:mainfrom
laskoviymishka:factory/encryption-readat-test-headroom
Open

laskoviymishka wants to merge 1 commit into
apache:mainfrom
laskoviymishka:factory/encryption-readat-test-headroom

Conversation

@laskoviymishka

Copy link
Copy Markdown
Contributor

TestStandardEncryptionManager_ConcurrentReadAtOverlaps flaked under -race on the macOS runner: it took 85.8 ms against its 80 ms bound on #2637 (run 44307730773) and failed the same way on #2602 (run 44246241526). This raises the simulated read delay from 20 ms to 100 ms and keeps the bound at half the serial time, so it moves to 400 ms while concurrent reads still take about 100 ms.

The test still catches serialization: holding cacheMu across the underlying read makes it fail locally. With the change it passed 20 runs in a row under -race. Only this one test changes.

AI-assisted, reviewed by a human.

TestStandardEncryptionManager_ConcurrentReadAtOverlaps runs 8 concurrent
ReadAt calls over a file with a simulated per-read delay and requires them
to finish within half of the serial time. With a 20 ms delay that bound is
80 ms, which leaves about 60 ms for scheduler jitter. Under -race on the
macOS runner that was not enough: the test took 85.8 ms on apache#2637 and
failed the same way on apache#2602.

Raise the delay to 100 ms and keep the bound at half the serial time
(400 ms). Concurrent reads still take about one delay, and a serialized
implementation takes about 800 ms and still fails.

Signed-off-by: laskoviymishka <laskoviymishka@gmail.com>
@laskoviymishka
laskoviymishka marked this pull request as ready for review November 19, 2026 08:06

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants