Milan Mihajlović
Milan Mihajlović

Reputation: 211

How to edit default go test timeout in Visual Studio Code?

I'm trying to edit default test timeout through Visual studio code Settings.json

Here are my go.testFlags:

"go.testFlags": [
 "-count=1",
 "1",
 "-v",
 "-timeout 30m"
 ],

But when I run test through vsc I see that timeout is still default (30 seconds)

Is there any way I could override default go test timeout setting?

I am aware I can pass it as flag like this:

go test -timeout 30m

Upvotes: 21

Views: 13111

Answers (2)

mohsen malvandy niko
mohsen malvandy niko

Reputation: 359

just change go.testTimeout in setting to 10m

isolated

or just set "go.testTimeout": "10m" on settings.json file

Upvotes: 9

Ravi Ragul
Ravi Ragul

Reputation: 293

You can use"go.testTimeout": "300s" on settings.json file. It worked for me.

Upvotes: 28

Related Questions