refactor: 성능 테스트 스크립트 수정

- 예약 시나리오 테스트에서는 VU 1000 -> 1500 증가
- 일정 생성 테스트에서는 전체 일정 생성 보장을 위한 duration 증가
This commit is contained in:
이상진 2025-10-14 09:50:47 +09:00
parent f12a930a6c
commit 4ced6ad3c3
2 changed files with 11 additions and 15 deletions

View File

@ -17,16 +17,10 @@ export const options = {
executor: 'ramping-vus', executor: 'ramping-vus',
startVUs: 0, startVUs: 0,
stages: [ stages: [
{ duration: '1m', target: 100 }, { duration: '3m', target: 500 },
{ duration: '1m', target: 200 }, { duration: '2m', target: 1000 },
{ duration: '1m', target: 300 }, { duration: '2m', target: 1500 },
{ duration: '1m', target: 300 }, { duration: '3m', target: 1500 },
{ duration: '1m', target: 400 },
{ duration: '1m', target: 500 },
{ duration: '2m', target: 500 },
{ duration: '1m', target: 600 },
{ duration: '1m', target: 800 },
{ duration: '1m', target: 1000 },
{ duration: '3m', target: 0 }, { duration: '3m', target: 0 },
] ]
} }
@ -84,13 +78,13 @@ export default function (data) {
const user = randomItem(users) const user = randomItem(users)
const accessToken = login(user.account, user.password, 'USER').accessToken const accessToken = login(user.account, user.password, 'USER').accessToken
const storeId = randomItem(stores).storeId let storeId = randomItem(stores).storeId
if (!accessToken) { if (!accessToken) {
console.log(`로그인 실패: token=${accessToken}`) console.log(`로그인 실패: token=${accessToken}`)
return return
} }
const targetDate = randomDayBetween(1, 4) let targetDate
let availableScheduleId, selectedThemeId, selectedThemeInfo, reservationId, totalAmount let availableScheduleId, selectedThemeId, selectedThemeInfo, reservationId, totalAmount
@ -99,6 +93,8 @@ export default function (data) {
let schedules let schedules
while (searchTrial < 5) { while (searchTrial < 5) {
storeId = randomItem(stores).storeId
targetDate = randomDayBetween(1, 7)
const res = http.get(`${BASE_URL}/stores/${storeId}/schedules?date=${targetDate}`) const res = http.get(`${BASE_URL}/stores/${storeId}/schedules?date=${targetDate}`)
const result = check(res, {'일정 조회 성공': (r) => r.status === 200}) const result = check(res, {'일정 조회 성공': (r) => r.status === 200})
if (result !== true) { if (result !== true) {
@ -145,7 +141,7 @@ export default function (data) {
let isScheduleHeld = false let isScheduleHeld = false
group(`일정 Holding 및 테마 정보 조회 -> 예약 과정중 첫 페이지의 작업 완료`, function () { group(`일정 Holding 및 테마 정보 조회 -> 예약 과정중 첫 페이지의 작업 완료`, function () {
const holdRes = http.post(`${BASE_URL}/schedules/${availableScheduleId}/hold`, null, getHeaders(accessToken)) const holdRes = http.post(`${BASE_URL}/schedules/${availableScheduleId}/hold`, null, getHeaders(accessToken))
const body = JSON.parse(holdRes) const body = JSON.parse(holdRes.body)
if (check(holdRes, {'일정 점유 성공': (r) => r.status === 200})) { if (check(holdRes, {'일정 점유 성공': (r) => r.status === 200})) {
const themeInfoRes = http.get(`${BASE_URL}/themes/${selectedThemeId}`) const themeInfoRes = http.get(`${BASE_URL}/themes/${selectedThemeId}`)

View File

@ -13,7 +13,7 @@ export const options = {
executor: 'shared-iterations', executor: 'shared-iterations',
vus: 263, vus: 263,
iterations: TOTAL_ITERATIONS, iterations: TOTAL_ITERATIONS,
maxDuration: '10m', maxDuration: '30m',
}, },
}, },
thresholds: { thresholds: {
@ -113,7 +113,7 @@ function createSchedule(storeId, accessToken, schedule) {
function generateDates(days) { function generateDates(days) {
const dates = []; const dates = [];
const today = new Date(); const today = new Date();
for (let i = 1; i < days; i++) { for (let i = 1; i <= days; i++) {
const date = new Date(today); const date = new Date(today);
date.setDate(today.getDate() + i); date.setDate(today.getDate() + i);
dates.push(date.toISOString().split('T')[0]); dates.push(date.toISOString().split('T')[0]);