errors in dependsOn background tasks do not prevent subsequent tasks from executing
See original GitHub issue- VSCode Version: 1.32.1
- OS Version: 18309
Steps to Reproduce:
create launch.json:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}\\src\\FrontEnd\\build",
"preLaunchTask": "core"
}
]
}
- create task.json:
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "core",
"type": "npm",
"script": "start",
"path": "src/FrontEnd/core/",
"isBackground": true,
"dependsOn":["loss"],
"problemMatcher":{
"owner": "custom",
"pattern":[
{
"regexp": "something not exists",
"file": 1,
"location": 2,
"message": 3
}
],
"background": {
"activeOnStart": true,
"beginsPattern": "core@1.0.0 start",
"endsPattern": "created ..\\\\build\\\\vendor.js"
}
}
},
{
"label": "loss",
"type": "npm",
"script": "watch",
"path": "src/FrontEnd/loss/",
"isBackground": true,
"problemMatcher":{
"owner": "custom",
"pattern":[
{
"regexp": "something not exists",
"file": 1,
"location": 2,
"message": 3
}
],
"background": {
"activeOnStart": true,
"beginsPattern": "loss@1.0.0 start",
"endsPattern": "waiting for changes"
}
}
}
]
}
I can use beginsPattern/endsPattern with no issue if I direct launched by preLaunchTask, but if I have DependsOn for same task, it will run the dependencies but can’t detect it’s status by using endsPattern, the task will hang there. it looks like a bug for me.
I tried to use the new Terminal: “terminal.integrated.windowsEnableConpty”: false/true, no difference. I tried to use presentation.panel:“dedicated”, no difference.
I think we have done a nice work on putting tasks running in background and launch, but not those tasks in DependsOn property.
Does this issue occur when all extensions are disabled?: Yes
Issue Analytics
- State:
- Created 5 years ago
- Reactions:27
- Comments:24 (5 by maintainers)
Top Results From Across the Web
UIApplication Background Task Notes - Apple Developer
The UIApplication background task mechanism allows you to prevent your app from being suspended for short periods of time. While the API involved...
Read more >Tasks in Visual Studio Code
Any background/watch tasks used in dependsOn with "dependsOrder": "sequence" must have a problem matcher that tracks when they are "done". The following task...
Read more >Debug a background task - UWP applications - Microsoft Learn
This topic assumes that you already have an existing app with a background task to debug. The following is specific to background tasks...
Read more >Background Tasks - FastAPI
You can define background tasks to be run after returning a response. This is useful for operations that need to happen after a...
Read more >iOS background processing - Background App Refresh Task
Performance: ensure background execution does not have any negative effect on active usage. Privacy: Users should be aware of background tasks ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@penx thanks for the simple repro repository.
Until now, you could have background tasks in
dependsOn
, but since those background tasks never “finish”, you couldn’t sequence anything off of them.I have pushed a small change that does allow some sequencing. You can have background tasks in
dependsOn
and they can be sequenced. However any errors that those background tasks produce will not prevent subsequent tasks from executing. I will leave this issue open to track supporting that.I created a basic repo that shows the issue of not being able to create a task that depends on a background/watch task:
https://github.com/penx/vscode-task-dependson
In this project:
As per @linusbrolin’s comment above, the documentation says that this should work:
… so please can you either mark this ticket as a bug or else update the documentation to make it clear this is not supported?
launch.json
tasks.json