Skip to content

Commit 12e5039

Browse files
APM-3416 Increase sync-wrap timeout to 59 seconds
1 parent b0b1faa commit 12e5039

3 files changed

Lines changed: 8 additions & 7 deletions

File tree

docker/sync-wrap/package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docker/sync-wrap/src/app.postman.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,23 +163,23 @@ describe("express with postman-echo", function () {
163163
.get("/delay/3")
164164
.set("x-sync-wait", "eek")
165165
.set("Accept", "application/json")
166-
.expect(400, {err: "x-sync-wait should be a number between 0.25 and 29"}, done);
166+
.expect(400, {err: "x-sync-wait should be a number between 0.25 and 59"}, done);
167167
});
168168

169169
it("it validates x-sync-wait is > lower bound", (done) => {
170170
request(server)
171171
.get("/delay/3")
172172
.set("x-sync-wait", "0.0001")
173173
.set("Accept", "application/json")
174-
.expect(400, {err: "x-sync-wait should be a number between 0.25 and 29"}, done);
174+
.expect(400, {err: "x-sync-wait should be a number between 0.25 and 59"}, done);
175175
});
176176

177177
it("it validates x-sync-wait is < upper bound", (done) => {
178178
request(server)
179179
.get("/delay/3")
180-
.set("x-sync-wait", "30")
180+
.set("x-sync-wait", "60")
181181
.set("Accept", "application/json")
182-
.expect(400, {err: "x-sync-wait should be a number between 0.25 and 29"}, done);
182+
.expect(400, {err: "x-sync-wait should be a number between 0.25 and 59"}, done);
183183
});
184184

185185
it("it times out if x-sync-wait shorter than initial response", (done) => {

docker/sync-wrap/src/handlers.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -335,16 +335,16 @@ async function proxy(req, res, next) {
335335
if(isNaN(syncWait)){
336336
res.status(400);
337337
res.json({
338-
err: "x-sync-wait should be a number between 0.25 and 29"
338+
err: "x-sync-wait should be a number between 0.25 and 59"
339339
});
340340
next();
341341
return;
342342
}
343343
syncWait = parseFloat(syncWait);
344-
if (syncWait < 0.25 || syncWait > 29) {
344+
if (syncWait < 0.25 || syncWait > 59) {
345345
res.status(400);
346346
res.json({
347-
err: "x-sync-wait should be a number between 0.25 and 29"
347+
err: "x-sync-wait should be a number between 0.25 and 59"
348348
});
349349
next();
350350
return;

0 commit comments

Comments
 (0)