chore: remove delay no-op handlers from chaos-v3, document name collision
This commit is contained in:
@@ -56,7 +56,7 @@ export interface ChaosApplicationResult {
|
|||||||
type InboundChaosHandler = (ctx: EvalContext, event: ChaosEvent) => EvalContext
|
type InboundChaosHandler = (ctx: EvalContext, event: ChaosEvent) => EvalContext
|
||||||
|
|
||||||
const inboundHandlers: Record<string, InboundChaosHandler> = {
|
const inboundHandlers: Record<string, InboundChaosHandler> = {
|
||||||
'inbound-delay': (ctx) => ctx,
|
// inbound-delay: handled at transport level via sleep(), not here
|
||||||
'inbound-error': (ctx, event) => ({
|
'inbound-error': (ctx, event) => ({
|
||||||
...ctx,
|
...ctx,
|
||||||
response: {
|
response: {
|
||||||
@@ -203,7 +203,7 @@ const outboundHandlers: Record<string, OutboundChaosHandler> = {
|
|||||||
}),
|
}),
|
||||||
'outbound-corruption': (response, event) =>
|
'outbound-corruption': (response, event) =>
|
||||||
applyCorruptionToDependencyResponse(response, event),
|
applyCorruptionToDependencyResponse(response, event),
|
||||||
'outbound-delay': (response) => response,
|
// outbound-delay: handled at transport level via sleep(), not here
|
||||||
}
|
}
|
||||||
|
|
||||||
export function applyChaosToDependencyResponse(
|
export function applyChaosToDependencyResponse(
|
||||||
@@ -239,6 +239,9 @@ function applyCorruptionToDependencyResponse(
|
|||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Apply all outbound chaos events to a set of dependency responses.
|
* Apply all outbound chaos events to a set of dependency responses.
|
||||||
|
* Note: triple-boundary-testing.ts defines a separate applyChaosToAllResponses
|
||||||
|
* with different types (DependencyResponseSample). This chaos-v3 version operates
|
||||||
|
* on DependencyResponse and is used by tests and the chaos handler.
|
||||||
*/
|
*/
|
||||||
export function applyChaosToAllResponses(
|
export function applyChaosToAllResponses(
|
||||||
responses: ReadonlyArray<DependencyResponse>,
|
responses: ReadonlyArray<DependencyResponse>,
|
||||||
|
|||||||
Reference in New Issue
Block a user