MCPcopy
hub / github.com/keploy/keploy / strictWindowEnabled

Function strictWindowEnabled

pkg/util.go:3085–3093  ·  view source on GitHub ↗

strictWindowEnabled returns true when strict containment should apply. Strict mode ships ON by default (config/default.go StrictMockWindow: true) now that every stateful-protocol recorder classifies mocks finely enough for legitimate cross-test sharing to be encoded as session/connection lifetime.

(perCall bool)

Source from the content-addressed store, hash-verified

3083// per-test mocks remain visible via the unfiltered pool so
3084// scoring-based matchers can still pick them up.
3085func strictWindowEnabled(perCall bool) bool {
3086 // Explicit env-var disable wins over everything else — escape
3087 // hatch for users whose recordings predate full Phase 2
3088 // classification coverage.
3089 if strictWindowEnvExplicitOff {
3090 return false
3091 }
3092 return perCall || strictWindowEnvOverride
3093}
3094
3095func filterByTimeStamp(_ context.Context, logger *zap.Logger, m []*models.Mock, afterTime time.Time, beforeTime time.Time, strictPerCall bool) ([]*models.Mock, []*models.Mock) {
3096 return filterByTimeStampTierAware(nil, logger, m, afterTime, beforeTime, strictPerCall, time.Time{})

Callers 3

IsStrictMockWindowFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected