Closed Jibbajabbafic closed 7 months ago
Thanks for the issue, I'm curious abt why you'd intentionally run the same task twice here.
So my actual use case is for testing a multiplayer game where I launch a server process and then multiple game clients that connect to it automatically when I launch the task, but I could also see this being useful for other applications that require multiple clients.
I also tried changing the runOption.instanceLimit
but it doesn't make a difference. Maybe this behaviour could be configured through that same option or a new one if needed?
Here's the actual tasks.json file I use with the workaround I mentioned above:
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"problemMatcher": {
"owner": "godot",
"fileLocation": [
"relative",
"${workspaceFolder}"
],
"pattern": [
{
"regexp": "^(.*?):\\s(.*?):\\s(.*)",
"severity": 1,
"code": 2,
"message": 3
},
{
"regexp": "^\\s*At: res://(.*):(\\d+)",
"file": 1,
"line": 2
}
]
},
"tasks": [
{
"label": "Server",
"type": "process",
"command": "godot",
"args": [
"--server"
],
"presentation": {
"group": "servers"
},
},
{
"label": "Client Host",
"type": "process",
"command": "godot",
"args": [
"--host"
],
"presentation": {
"group": "clients"
},
},
{
"label": "Client Join",
"type": "process",
"command": "godot",
"args": [
"--join",
"127.0.0.1"
],
"presentation": {
"group": "clients"
},
},
{
"label": "Client Join 2",
"type": "process",
"command": "godot",
"args": [
"--join",
"127.0.0.1"
],
"presentation": {
"group": "clients"
},
},
{
"label": "Client Join 3",
"type": "process",
"command": "godot",
"args": [
"--join",
"127.0.0.1"
],
"presentation": {
"group": "clients"
},
},
{
"label": "Client Join 4",
"type": "process",
"command": "godot",
"args": [
"--join",
"127.0.0.1"
],
"presentation": {
"group": "clients"
},
},
{
"label": "Start 2 Clients",
"dependsOn": [
"Client Host",
"Client Join"
],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "Start 4 Clients",
"dependsOn": [
"Client Host",
"Client Join",
"Client Join 2",
"Client Join 3"
],
"group": {
"kind": "build"
}
},
{
"label": "Start Server and 2 Clients",
"dependsOn": [
"Client Join",
"Client Join 2",
"Server"
],
},
{
"label": "Export Windows",
"type": "shell",
"command": "mkdir -p builds/windows && godot --export windows",
},
{
"label": "Export Mac",
"type": "shell",
"command": "mkdir -p builds/mac && godot --export mac",
},
{
"label": "Export Linux",
"type": "shell",
"command": "mkdir -p builds/linux && godot --export linux",
},
{
"label": "Export All",
"dependsOn": [
"Export Windows",
"Export Mac",
"Export Linux"
],
}
]
}
This is happening because of https://github.com/microsoft/vscode/pull/180617
Thanks for the repro and for the issue. Since there is a workaround for this, I am closing this as I think the fix for it would cause bugs to resurface like the ones fixed by that PR I mentioned above.
Ok, thanks for looking into it anyways!
Type: Bug
Previously, multiple instances of the same task could be run in a compound tasks using the
dependsOn
option but this appears to have stopped working at some point. This feature is useful for testing e.g. to run a server and multiple clients together.There is a workaround of duplicating tasks and giving them different names but this feels like it shouldn't be needed as this used to work correctly.
Tested on 1.82.2 and the latest 1.83.0-insider. Possibly related to #164485 or #159640 (there are also multiple duplicate issues that reference this one).
Here's a tasks.json that reproduces this with the workaround.
VS Code version: Code - Insiders 1.83.0-insider (c72447e8d8aaa7497c9a4bd68bc4301584b92beb, 2023-09-22T09:29:47.641Z) OS version: Windows_NT x64 10.0.19045 Modes:
System Info
|Item|Value| |---|---| |CPUs|AMD Ryzen 9 5900X 12-Core Processor (24 x 3700)| |GPU Status|2d_canvas: enabledcanvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|31.91GB (17.32GB free)| |Process Argv|| |Screen Reader|no| |VM|0%|
Extensions (1)
Extension|Author (truncated)|Version ---|---|--- remote-wsl|ms-|0.81.4A/B Experiments
``` vsliv695:30137379 vsins829:30139715 vsliv368cf:30146710 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 pythontb:30258533 pythonptprofiler:30281269 vshan820:30294714 vscod805cf:30301675 bridge0708:30335490 bridge0723:30353136 vsaa593:30376534 pythonvs932:30404738 py29gd2263:30784851 vsclangdf:30492506 c4g48928:30535728 dsvsc012cf:30540253 pynewext54:30618038 a9j8j154:30646983 showlangstatbar:30737417 24365598:30687740 pythonfmttext:30716741 f8hc8238:30694864 fixshowwlkth:30771523 showindicator:30805243 pythongtdpath:30726887 i26e3531:30792625 welcomedialog:30812478 pythonnosmt12:30779711 pythonidxpt:30768918 pythonnoceb:30776497 copilotsettingt:30808721 asynctok:30821568 dsvsc013:30777762 dsvsc014:30777825 diffeditorv2:30786206 pythonlinttypecf:30823782 pythonmpsinfo:30842935 dsvsc015:30821418 pythontestfixt:30826906 pythonfb280951:30830809 pythonregdiag:30842812 pythonmypyd1cf:30841191 ```