Commit 6f45806
fix(restheart-mongo): deterministic GraphQL app cache + expires_in noise
The keploy restheart-mongo lane flaked on two recorded fields; both are
app/JWT non-determinism, fixed the same way the lane already handles the
ACL cache and the access_token JWT:
1. post-graphql-halpeople (mongo mock-miss -> 500 MongoSocketReadException):
RESTHeart's GraphQL service caches gql-apps app definitions with a 60s
time-to-revalidate (app-cache-ttr, Caffeine nanoTime ticker) — the exact
same time-freeze x cache-ttl interaction already documented for
/mongoAclAuthorizer. Under `keploy test --freezeTime` the ticker is
frozen, so the app cache never revalidates and RESTHeart issues a
different number/order of `find gql-apps` mongo queries than were
recorded; the unmatched find has no mock so keploy's mongo proxy closes
the socket and RESTHeart returns 500 instead of the recorded response.
Fix: add /graphql/app-cache-enabled->false to RHO so gql-apps is
read-through every request (identical mongo stream at record & replay),
mirroring the existing /mongoAclAuthorizer/cache-enabled->false.
2. post-token (expires_in 872 vs 871): /tokens returns expires_in =
seconds-until-exp computed at request time; it can differ by 1s across
record/replay when the request straddles a second boundary, even under
--freezeTime. The JWT itself (access_token) is already noised; add
expires_in to globalNoise.body for the same reason.
Signed-off-by: Shubham Jain <shubham@keploy.io>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: slayerjain <shubham@keploy.io>1 parent 21b7eee commit 6f45806
2 files changed
Lines changed: 24 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
62 | 78 | | |
63 | 79 | | |
64 | 80 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
0 commit comments