Skip to content

Commit

Permalink
chore: fix http fail
Browse files Browse the repository at this point in the history
  • Loading branch information
junha-ahn committed Oct 29, 2023
1 parent a542e1d commit 1d80069
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/performanceTest/scripts/lib/hooks.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { htmlReport } from "https://raw.githubusercontent.com/benc-uk/k6-reporter/main/dist/bundle.js";
import { textSummary } from "https://jslib.k6.io/k6-summary/0.0.1/index.js";
import config from "./config.js";
import http from "k6/http";

http.setResponseCallback(http.expectedStatuses({ min: 200, max: 499 }));

export default {
setup: function() {

console.log(`setup: ${new Date().toISOString()}`)
// https://stackoverflow.com/questions/73458542/k6-storing-data-between-setup-and-default-functions
return {
Expand Down
3 changes: 2 additions & 1 deletion src/performanceTest/scripts/spikeTest/spikeTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,6 @@ export default function () {
check(req.getEvent(eventId), {"EVENT 98 maxAttendees = 191": (r) => r.json().data.maxAttendees === 191})

const res = req.createReservation(generator.Reservation(eventId))
check(res, {"Success Reservation": (r) => isSuccess(r) || isAlreadReservedAll(r)});
check(res, {"Success Reservation": isSuccess});
check(res, {"Already reserved": isAlreadReservedAll});
}

0 comments on commit 1d80069

Please sign in to comment.