pester / vscode-adapter

Run PowerShell Pester Tests with Visual Studio Code
MIT License
58 stars 13 forks source link

Tests pane doesn't show up for my projects #92

Closed Glober777 closed 2 years ago

Glober777 commented 2 years ago

After some time of successfully usage of this extension, I've started experiencing an issue where the Testing panel stopped showing up. While digging through the Logs (Extension Host) I've noticed the following line (for a session when I have my project opened):

[2021-12-15 22:40:26.699] [exthost] [info] Not activating extension 'pspester.pester-test': Timed out while searching for 'workspaceContains' pattern **/*.[tT]ests.[pP][sS]1

Any idea of how to fix that?

There are actually a few other extensions that also timeout in the same fashion:

[2021-12-15 23:14:50.580] [exthost] [info] Not activating extension 'ms-azuretools.vscode-azurefunctions': Timed out while searching for 'workspaceContains' pattern **/host.json
[2021-12-15 23:14:50.580] [exthost] [info] Not activating extension 'ms-dotnettools.csharp': Timed out while searching for 'workspaceContains' pattern *.csproj,*.sln,*.slnf,*.csx,*.cake,**/*.csproj,**/*.sln,**/*.slnf,**/*.csx,**/*.cake

Thanks!

JustinGrote commented 2 years ago

Are you actually opening a workspace? Not sure why it would time out, I currently can't reproduce.

lujomu commented 2 years ago

Happened to me too, a couple of times already. Same 'Timed out' log entry. In a workspace with 23 test files, containing 335 tests; discovery takes about 2s. After a restart of VSCode, the extension usually loads successfully.

JustinGrote commented 2 years ago

@Glober777 @lujomu This is an extension host level issue, and maybe due to your slow filesystem, if the global search takes longer than the hard-coded 7 seconds. https://github.com/microsoft/vscode/blob/b4cd3749542a0da6f9cf830d49fdc4bd9e9bc4f5/src/vs/workbench/api/node/extHostExtensionService.ts#L50

Related Locked Issue https://github.com/microsoft/vscode/issues/73656

I'm afraid you'd have to petition vscode itself to increase the filesystem search limit, or speed up your filesystem so it can be searched in the requisite time, or otherwise propose another activation event for the extension rather than the presence of .tests.ps1 files (this has to be defined in the package.json and is not configurable)

Glober777 commented 1 year ago

@JustinGrote, just as a thought, but is it possible to maybe make an alternate activation expression that would depend on, say, something added to the settings.json file for the project? If that was possible, I'd just add that into Plaster template for my PowerShell projects.

Often times I need to reload VSCode a few times to make it activate the extension. And I don't really have large project folders. Not, to mention that I have an NVMe drive, and the utilization doesn't go above few percent during the load, however CPU does max out (supposedly due all the extensions starting up at the same time). I suspect that it may have something to do with the fact that I keep my project folders on OneDrive, and I wonder whether it is what is slowing file scan operations for me.

JustinGrote commented 1 year ago

@JustinGrote, just as a thought, but is it possible to maybe make an alternate activation expression that would depend on, say, something added to the settings.json file for the project? If that was possible, I'd just add that into Plaster template for my PowerShell projects.

Often times I need to reload VSCode a few times to make it activate the extension. And I don't really have large project folders. Not, to mention that I have an NVMe drive, and the utilization doesn't go above few percent during the load, however CPU does max out (supposedly due all the extensions starting up at the same time). I suspect that it may have something to do with the fact that I keep my project folders on OneDrive, and I wonder whether it is what is slowing file scan operations for me.

It would be possible by firing an event command if a setting exists, but it's not either/or. I suppose I could shortcut the full extension load if a setting is present.

Glober777 commented 1 year ago

@JustinGrote, just as a thought, but is it possible to maybe make an alternate activation expression that would depend on, say, something added to the settings.json file for the project? If that was possible, I'd just add that into Plaster template for my PowerShell projects. Often times I need to reload VSCode a few times to make it activate the extension. And I don't really have large project folders. Not, to mention that I have an NVMe drive, and the utilization doesn't go above few percent during the load, however CPU does max out (supposedly due all the extensions starting up at the same time). I suspect that it may have something to do with the fact that I keep my project folders on OneDrive, and I wonder whether it is what is slowing file scan operations for me.

It would be possible by firing an event command if a setting exists, but it's not either/or. I suppose I could shortcut the full extension load if a setting is present.

That would be awesome!

JustinGrote commented 1 year ago

The extension now lazy loads eventually with filewatchers only, so as long as you have a pester test that matches the file watchers, the extension will fully activate, otherwise it is "activated" but basically in sleep mode to conserve resources.