Skip to content

Commit

Permalink
Slow down test to increase stability
Browse files Browse the repository at this point in the history
  • Loading branch information
jblievremont committed Sep 24, 2024
1 parent b7258a3 commit 71230d6
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions test/suite/connectionsetup.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { SonarLintExtendedLanguageClient } from '../../src/lsp/client';
import { assert } from 'chai';
import { Organization } from '../../src/lsp/protocol';

const FIVE_SECONDS = 5000;
const TEN_SECONDS = 10_000;

async function deleteConnectedModeSettings() {
await vscode.workspace.getConfiguration('sonarlint')
Expand Down Expand Up @@ -53,7 +53,7 @@ const mockSecretStorage = {
suite('Connection Setup', () => {

const mockedConnectionSettingsService = new ConnectionSettingsService(mockSecretStorage, mockClient);
const sleepTime = 1000;
const sleepTime = 2000;

setup(async () => {
await deleteConnectedModeSettings();
Expand Down Expand Up @@ -86,7 +86,7 @@ suite('Connection Setup', () => {

const connectionsAfter = getSonarQubeConnections();
assert.deepStrictEqual(connectionsAfter, [{ connectionId: serverUrl, serverUrl }]);
}).timeout(FIVE_SECONDS);
}).timeout(TEN_SECONDS);

test('Should provide default connectionId', async () => {
const connectionsBefore = getSonarQubeConnections();
Expand All @@ -109,7 +109,7 @@ suite('Connection Setup', () => {
// @ts-ignore
assert.deepStrictEqual(message.connectionId, serverUrl);

}).timeout(FIVE_SECONDS);
}).timeout(TEN_SECONDS);

test('should show SonarCloud creation webview when command is called', async () => {
const connectionsBefore = getSonarCloudConnections();
Expand All @@ -132,7 +132,7 @@ suite('Connection Setup', () => {

const connectionsAfter = getSonarCloudConnections();
assert.deepStrictEqual(connectionsAfter, [{ connectionId:organizationKey, organizationKey }]);
}).timeout(FIVE_SECONDS);
}).timeout(TEN_SECONDS);

test('should edit default connection when command is called', async () => {
const connectionsBefore = getSonarQubeConnections();
Expand Down Expand Up @@ -165,7 +165,7 @@ suite('Connection Setup', () => {

const connectionsAfter = getSonarQubeConnections();
assert.deepStrictEqual(connectionsAfter, [{connectionId, serverUrl, disableNotifications }]);
}).timeout(FIVE_SECONDS);
}).timeout(TEN_SECONDS);

test('should edit identified SonarQube connection when command is called', async () => {
const connectionsBefore = getSonarQubeConnections();
Expand Down Expand Up @@ -201,7 +201,7 @@ suite('Connection Setup', () => {

const connectionsAfter = getSonarQubeConnections();
assert.deepStrictEqual(connectionsAfter, [{ connectionId, serverUrl, disableNotifications }]);
}).timeout(FIVE_SECONDS);
}).timeout(TEN_SECONDS);

test('should edit identified SonarCloud connection when command is called', async () => {
const connectionsBefore = getSonarCloudConnections();
Expand Down Expand Up @@ -237,7 +237,7 @@ suite('Connection Setup', () => {

const connectionsAfter = getSonarCloudConnections();
assert.deepStrictEqual(connectionsAfter, [{ connectionId, organizationKey, disableNotifications }]);
}).timeout(FIVE_SECONDS);
}).timeout(TEN_SECONDS);

test('should NOT edit connection for which status check failed', async () => {
const mockClient = {
Expand Down Expand Up @@ -275,7 +275,7 @@ suite('Connection Setup', () => {
await sleep(sleepTime);

assert.deepStrictEqual(getSonarQubeConnections(), [{ serverUrl, connectionId }]);
}).timeout(FIVE_SECONDS);
}).timeout(TEN_SECONDS);
});

function getSonarQubeConnections() {
Expand Down

0 comments on commit 71230d6

Please sign in to comment.