Repository navigation
test(ci): take the shared s3-test.sh that checks its fake clock - #41
Merged
Merged
Conversation
s3-test.sh is the suite for s3.sh, and the pair is meant to be one shared copy: every keploy repo that carries it pins its hashes, and a change goes into all of them together. This moves keploy-ci-node's s3-test.sh to the new copy and its pin to the new hash, a10f2713. s3.sh does not change (40da95b4). What the new copy catches that the old one did not: - Two cases move the fake clock themselves: stdin that arrives 4 s late to put, and a reader that stops for 3 s on cat. Nothing checked that the clock moved, so with that step a no-op every case still passed, and so did the s3.sh mutants those cases are there for (the first request not counted as progress, the reader not counted as progress). Each case now checks the clock it ends at, 1004 and 1003. - FAKE_SLEEP_LATE=N makes the stub sleep end N s late, as a sleep does on a loaded box. Two new cases use it. Once S3_OP_TIMEOUT's deadline is reached, no request is made (exit 5, one call). With 1 s left, the request is still made, its connect timeout cut to 1 s. No case reached s3.sh's refusal before: with it removed, or with its check made >= 0, every case passed. - The fake clock file is written whole (a new file renamed over it), so a reader never finds it empty. FAKE_CLOCK and FAKE_SLEEP_LATE are unset before the stubs are written, so the runner's environment cannot set them. Signed-off-by: slayerjain <shubhamkjain@outlook.com>
slayerjain
marked this pull request as ready for review
October 24, 2026 16:42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
s3.shands3-test.share meant to be one shared pair: every keploy repo that carries them pins their sha256, and a change goes into all of them together. Today the carriers other than keploy/enterprise and playwrightDB have the previous pair (the "before" column). The final pair is on keploy/enterprise's branchtrain/fix/s3-op-timeout-by-progress-next(46c66c5e5), which is to become keploy/enterprise#2929's head; keploy/playwrightDB#37 is to move playwrightDB to it. This PR copies the new shareds3-test.shintokeploy-ci-nodebyte for byte and moves the pin in.github/workflows/docker-build.yml(want_test) to its hash.s3.shdoes not change.s3.sh40da95b471bb8e77f7851b2a32b04317b3743f3a289b730b10caf01145e8fbacs3-test.shbb41f8ad34ed3a4e5fc8c225214b98fedf778cc2b780074dfe44681c0580b268a10f2713f30cc6b42c8be68c50fcce099aae5718178dbd3b7261637760b38321What the suite now catches
The fake clock is checked. Two cases move it themselves: stdin that arrives 4 s late to
put, and a reader that stops for 3 s oncat. Nothing checked that the clock moved. With that step a no-op, every case still passed, and so did the twos3.shmutants those cases are there for: the first request not counted as progress, and the reader not counted as progress. Each case now checks the clock it ends at, 1004 and 1003. Neither case makes a backoff, so the value is exact.S3_OP_TIMEOUT's deadline refusal is reached.FAKE_SLEEP_LATE=Nmakes the stub sleep end N s late, as a sleep does on a loaded box. Two new cases use it:No case reached that refusal before. With it removed, or with its check made
-ge 0, every case passed.The fake clock can't be read half-written or set from outside. The clock file is written whole (a new file renamed over it), so a reader never finds it empty.
FAKE_CLOCKandFAKE_SLEEP_LATEare unset before the stubs are written, so the runner's environment can't set them.Verification
s3-test.shhermetic on an amd64 box: ALL PASS undershandbash.bb41f8ad, withs3.sh40da95b4), under bash, sh, dash and busybox ash: with the two cases' own clock step a no-op, every case passes, alone and with each of the twos3.shprogress mutants; with the deadline refusal removed, or its check made-ge 0, every case passes too.s3.shands3-test.shbytes as 46c66c5e5 (the commit that is to become keploy/enterprise#2929's head, on branchtrain/fix/s3-op-timeout-by-progress-next; the runs were on main 591b20c16, before a rebase that changes neither file). A tick that is a no-op, one second short or one second long fails both clock cases under bash, dash and busybox ash, and so does a no-op tick with eachs3.shprogress mutant. The two deadline mutants fail under bash, sh and dash.Order
Every carrier takes this pair before keploy/enterprise#2929 merges, and keploy/enterprise#3067 tracks them. No carrier's guard reads another repo's copy, so this PR is green on its own.