Skip to content

Commit

Permalink
#333 test: improve trainer passthrough test
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolkenfarmer committed Oct 12, 2024
1 parent 2ccbf53 commit 89d648e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 157 deletions.
159 changes: 4 additions & 155 deletions testing/backend-stress/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion testing/backend-stress/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ let workerCount = 0;

function startWorker(userIndex) {
return new Promise((resolve, reject) => {
const worker = new Worker('./exercise.js', {
const worker = new Worker('./trainerPassthrough.js', {
workerData: { userIndex }
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ async function simulateExercise(userIndex) {
socketTrainer.connect(token, response => resolve(response));
});

socketTrainer.testPassthrough((message) => {console.log(message)})
socketTrainer.testPassthrough((message) => {
console.log(message)
socketTrainer.close()
parentPort.close()
})

const endTime = now();

Expand All @@ -38,6 +42,7 @@ async function simulateExercise(userIndex) {
success: false,
error: error.message
});
parentPort.close()
}
}

Expand Down

0 comments on commit 89d648e

Please sign in to comment.