Skip to content

Commit

Permalink
test: wait for sever to disconnect before sending next request
Browse files Browse the repository at this point in the history
  • Loading branch information
sockmaster27 committed Apr 28, 2024
1 parent b924074 commit fccc500
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/src/disconnect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand All @@ -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)
Expand Down

0 comments on commit fccc500

Please sign in to comment.