Skip to content

Comments

Fix long running tests#1372

Merged
nturinski merged 11 commits intomainfrom
nat/fixLongRunningTests
Feb 18, 2026
Merged

Fix long running tests#1372
nturinski merged 11 commits intomainfrom
nat/fixLongRunningTests

Conversation

@nturinski
Copy link
Member

Make sure we are using the AzDevOps provider whenever we are doing the crud tests.

@nturinski nturinski requested a review from a team as a code owner February 18, 2026 04:33
Copilot AI review requested due to automatic review settings February 18, 2026 04:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes issues with long-running nightly tests by ensuring the Azure DevOps subscription provider is properly authenticated and by handling race conditions during test setup.

Changes:

  • Added explicit sign-in step to Azure DevOps subscription provider setup to ensure authentication is complete before tests run
  • Enhanced test setup to re-establish the provider and handle race conditions with tree refresh operations
  • Added defensive null-check for outputChannel in error handling to prevent crashes during test initialization

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
test/utils/azureDevOpsSubscriptionProvider.ts Added sign-in step after provider creation to ensure authentication is established before tests use the provider
test/nightly/crud.test.ts Re-establishes AzDO provider after clearing mock overrides, adds tree refresh synchronization, and improves subscription filtering to skip tests gracefully when no subscriptions are available
src/utils/wrapFunctionsInTelemetry.ts Added optional chaining to outputChannel access to handle edge cases where it might not be initialized

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

// the logIn command in global.nightly.test.ts) cancels our getChildren() call
// via the shared cancellation token in AzureResourceTreeDataProvider.
await vscode.commands.executeCommand('azureResourceGroups.refresh');
await new Promise(resolve => setTimeout(resolve, 2000));
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hard-coded 2000ms timeout is a potential source of test flakiness. If the tree refresh takes longer than expected (due to slow CI or other factors), the test may fail intermittently. Consider alternatives such as polling for the tree state or using an event-based approach to detect when the refresh is complete. If a hard-coded timeout is necessary, consider making it configurable via an environment variable or increasing it to a more conservative value.

Copilot uses AI. Check for mistakes.
@nturinski nturinski merged commit 0f67695 into main Feb 18, 2026
9 checks passed
@nturinski nturinski deleted the nat/fixLongRunningTests branch February 18, 2026 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants