Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
말씀하신 부분에 대해 test 를 진행해보았습니다.
가장 애를 먹었던 건 동시성 테스트였습니다.
PR에 올라온 하나의 테스트와 더불어서 동시에 여러가지 test를 진행하려고 했을 때 @beforeeach annotation이 붙은 foodRepository.saveAndFlush(dummyFood); 에서 동시성 문제가 일어나는 것을 확인했습니다.
이를 해결하기 위해
등등 을 시도해보았지만 다 실패하였습니다..
결론적으로 한 파일에 다 테스트를 놓는 것 보다 따로 다른 test file을 만들어서 동시성을 검증하는 게 낫다는 결론에 이르렀습니다.
혹시 죄송하지만 근본적인 해결방법에 대한 아이디어가 있으시다면 여쭤봐도 될까요?