File tree Expand file tree Collapse file tree 3 files changed +13
-5
lines changed
packages/compass-smoke-tests/src/tests Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 11import assert from 'node:assert/strict' ;
2- import fs from 'node:fs' ;
2+
33import createDebug from 'debug' ;
4+
45import { type SmokeTestsContext } from '../context' ;
56import { getInstaller } from '../installers' ;
67import { createSandbox } from '../directories' ;
78import { getTestSubject } from '../test-subject' ;
89import { executeAsync } from '../execute' ;
9- import { startAutoUpdateServer } from './update-server' ;
10+ import { startAutoUpdateServer , stopAutoUpdateServer } from './update-server' ;
1011
1112const debug = createDebug ( 'compass:smoketests:auto-update-from' ) ;
1213
@@ -66,7 +67,7 @@ export async function testAutoUpdateFrom(context: SmokeTestsContext) {
6667 ) ;
6768 } finally {
6869 debug ( 'Stopping auto-update server' ) ;
69- server . close ( ) ;
70+ await stopAutoUpdateServer ( server ) ;
7071 delete process . env . UPDATE_CHECKER_ALLOW_DOWNGRADES ;
7172 }
7273 } finally {
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import { createSandbox } from '../directories';
77import { getTestSubjectDetails } from '../test-subject' ;
88import { executeAsync } from '../execute' ;
99import { getLatestRelease , getLatestReleaseKindByKind } from '../releases' ;
10- import { startAutoUpdateServer } from './update-server' ;
10+ import { startAutoUpdateServer , stopAutoUpdateServer } from './update-server' ;
1111
1212const debug = createDebug ( 'compass:smoketests:auto-update-to' ) ;
1313
@@ -100,7 +100,7 @@ export async function testAutoUpdateTo(context: SmokeTestsContext) {
100100 ) ;
101101 } finally {
102102 debug ( 'Stopping auto-update server' ) ;
103- server . close ( ) ;
103+ await stopAutoUpdateServer ( server ) ;
104104 delete process . env . DEV_RELEASE ;
105105 delete process . env . PUBLISHED_RELEASES ;
106106 delete process . env . UPDATE_CHECKER_ALLOW_DOWNGRADES ;
Original file line number Diff line number Diff line change 11import { once } from 'node:events' ;
2+ import type http from 'node:http' ;
3+ import { promisify } from 'node:util' ;
4+
25import createDebug from 'debug' ;
36
47const debug = createDebug ( 'compass:smoketests:update-server' ) ;
@@ -20,3 +23,7 @@ export async function startAutoUpdateServer() {
2023
2124 return httpServer ;
2225}
26+
27+ export async function stopAutoUpdateServer ( server : http . Server ) {
28+ await promisify ( server . close . bind ( server ) ) ( ) ;
29+ }
You can’t perform that action at this time.
0 commit comments