From fccc50015ee8ba079284a8f35a11f081a3359222 Mon Sep 17 00:00:00 2001 From: sockmaster27 <61235930+sockmaster27@users.noreply.github.com> Date: Sun, 28 Apr 2024 10:45:05 +0200 Subject: [PATCH] test: wait for sever to disconnect before sending next request --- test/src/disconnect.test.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/src/disconnect.test.ts b/test/src/disconnect.test.ts index 8c2d32e7..db3e52e8 100644 --- a/test/src/disconnect.test.ts +++ b/test/src/disconnect.test.ts @@ -16,7 +16,7 @@ import * as assert from 'assert' import * as vscode from 'vscode' -import { activate, getTestDocUri } from './util' +import { activate, getTestDocUri, sleep } from './util' suite('Server disconnect', () => { suiteSetup(async () => { @@ -26,6 +26,9 @@ suite('Server disconnect', () => { test('When server is disconnected a reconnection should happen automatically', async () => { await vscode.commands.executeCommand('flix.simulateDisconnect') + // Wait for the server to disconnect, otherwise the next command will hang + await sleep(1000) + // Ensure that the server is reconnected const docUri = getTestDocUri('src/Main.flix') const position = new vscode.Position(9, 12)