Skip to content

Commit

Permalink
fix: http-server test
Browse files Browse the repository at this point in the history
  • Loading branch information
bretthoerner committed Sep 15, 2023
1 parent e771c7d commit 246c378
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion plugin-server/src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import {
KAFKA_EVENTS_PLUGIN_INGESTION_OVERFLOW,
} from './kafka-topics'

export const DEFAULT_HTTP_SERVER_PORT = 6738

export const defaultConfig = overrideWithEnv(getDefaultConfig())

export function getDefaultConfig(): PluginsServerConfig {
Expand Down Expand Up @@ -75,7 +77,7 @@ export function getDefaultConfig(): PluginsServerConfig {
SENTRY_DSN: null,
SENTRY_PLUGIN_SERVER_TRACING_SAMPLE_RATE: 0,
SENTRY_PLUGIN_SERVER_PROFILING_SAMPLE_RATE: 0,
HTTP_SERVER_PORT: 6738,
HTTP_SERVER_PORT: DEFAULT_HTTP_SERVER_PORT,
STATSD_HOST: null,
STATSD_PORT: 8125,
STATSD_PREFIX: 'plugin-server.',
Expand Down
6 changes: 3 additions & 3 deletions plugin-server/tests/http-server.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import http from 'http'

import { DEFAULT_HTTP_SERVER_PORT } from '../src/config/config'
import { startPluginsServer } from '../src/main/pluginsServer'
import { HTTP_SERVER_PORT } from '../src/main/services/http-server'
import { makePiscina } from '../src/worker/piscina'
import { resetTestDatabase } from './helpers/sql'

Expand Down Expand Up @@ -40,7 +40,7 @@ describe('http server', () => {
)

await new Promise((resolve) =>
http.get(`http://localhost:${HTTP_SERVER_PORT}/_health`, (res) => {
http.get(`http://localhost:${DEFAULT_HTTP_SERVER_PORT}/_health`, (res) => {
const { statusCode } = res
expect(statusCode).toEqual(200)
resolve(null)
Expand Down Expand Up @@ -68,7 +68,7 @@ describe('http server', () => {
)

await new Promise((resolve) =>
http.get(`http://localhost:${HTTP_SERVER_PORT}/_ready`, (res) => {
http.get(`http://localhost:${DEFAULT_HTTP_SERVER_PORT}/_ready`, (res) => {
const { statusCode } = res
expect(statusCode).toEqual(200)
resolve(null)
Expand Down

0 comments on commit 246c378

Please sign in to comment.