When you are running your test file, are you first opening the Julia REPL via the command palette in VSCode?
I actually had this same problem awhile ago. Initially I solved it by changing the environment variables within the terminal in VSCode (which was annoying to do every time). Then I figured out that if I started a Julia REPL with the command palette (ctrl + shift + p and search for julia) it would open with the number of threads specified in my VSC settings.