Definitely stop doing WK lessons, and stop adding any new flashcards to Anki. If Anki is really causing too much trouble, you can set a daily review cap for your deck so that it limits how many cards it shows you a day.
I would recommend, if possible, continuing to do your reviews for both WK and Anki every day until things calm down. As long as you stop adding new cards, your daily workload should go down. If you stop doing your reviews, you’re much more likely to quit, so it’s best to tough it out until things get easier again.
Once your WK and Anki reviews are at an actually manageable level that isn’t causing you strain and isn’t forcing you to lose sleep, you can consider adding new cards, but if you do, you’ll want to add them at a much, much slower rate than you were adding things before.
With WK, I recommend doing a small but consistent number of lessons a day (instead of binging them, if that’s what you were doing before). 10 lessons a day typically isn’t too bad, but if you’re spending a lot of time studying Japanese outside of WK, doing even fewer might be a good idea. The more consistent your lesson schedule, the more consistent your review schedule will be, which often makes it easier to manage. If WK starts taking too much time again, you can scale back on lessons even further or stop doing new lessons for a bit.
With Anki, it sounds like you were adding way too many new cards a day. I highly recommend cutting the number of new cards in half at the very least. If your daily cap was at 20, maybe try changing it to 10. If that’s still too much, drop it even further.
If you take a break from adding new material with both WK and Anki and then find a new WK and Anki pace that is actually sustainable for you, you might realize that it’s not fast enough for you to reach your goals before the JLPT. If this does happen, that’s okay. Don’t try to push yourself beyond your own limits. You’ll be way better off sticking to a pace that you can actually keep up with for the long term without sacrificing your health, even if it means taking a little longer to reach the level of proficiency that you want to reach.
As others have said, learning a language is a marathon, not a sprint. This is especially true if you’re using any sort of SRS (especially if you’re using two). You will make progress as long as you put in the work every single day, so it’s important that your daily workload is something doable and achievable to you without causing you distress or strain. Decisions that you make today will affect your future self days, weeks, and months down the line, so make sure that you’re kind to your future self. You’ll want to plan your daily workload around what you can get done even on a bad day, not in ideal circumstances.
So just take a deep breath, stop thinking about the test (burning out and quitting would be a far worse outcome than failing a test!), and focus on doing the reviews that you have already accumulated without adding any new work. When things have settled down again, you can reevaluate your approach.