Skip to content

feat: add slow-time-server for timeout, resilience, and load testing#2865

Merged
crivetimihai merged 4 commits intomainfrom
slow-time-server
Feb 15, 2026
Merged

feat: add slow-time-server for timeout, resilience, and load testing#2865
crivetimihai merged 4 commits intomainfrom
slow-time-server

Conversation

@crivetimihai
Copy link
Copy Markdown
Member

Summary

Implements #2783. Adds a configurable-latency Go MCP server (mcp-servers/go/slow-time-server/) modelled on fast-time-server that introduces artificial delays on every tool call. Serves as a testing target for gateway timeout enforcement, circuit breaker behaviour, session pool resilience, and load testing under realistic slow-tool conditions.

  • 5 MCP tools: get_slow_time, convert_slow_time, get_instant_time, get_timeout_time, get_flaky_time
  • 4 latency distributions: fixed, uniform, normal, exponential
  • Failure simulation: configurable rate (0.0-1.0) and mode (timeout, error, panic)
  • Runtime reconfiguration via REST POST /api/v1/config
  • Invocation stats with p50/p95/p99 percentiles
  • 32 unit tests with race detection, all passing
  • Docker Compose integration in both docker-compose.yml (testing profile, port 8889) and docker-compose-performance.yml
  • Locust load test with 4 scenarios: slow time, timeout storm, mixed latency, circuit breaker
  • Documentation at docs/docs/using/servers/go/slow-time-server.md

Files

Area Files Description
Server mcp-servers/go/slow-time-server/ (main.go, rest_handlers.go, openapi.go, main_test.go, Makefile, Dockerfile, README.md) Core implementation
Docker docker-compose.yml, docker-compose-performance.yml Service + auto-registration
Load test tests/loadtest/locustfile_slow_time_server.py 4 Locust user classes
Docs docs/docs/using/servers/go/slow-time-server.md, .pages User documentation
Meta mcp-servers/AGENTS.md Directory listing update

Test plan

  • go test -race -timeout=90s ./... -- 32/32 pass
  • go vet ./... -- clean
  • go build -- clean
  • docker compose --profile testing config --services -- validates YAML, shows both new services

Closes #2783

@crivetimihai crivetimihai self-assigned this Feb 12, 2026
@crivetimihai crivetimihai added testing Testing (unit, e2e, manual, automated, etc) mcp-servers MCP Server Samples test-automation Automated testing labels Feb 12, 2026
@crivetimihai crivetimihai force-pushed the slow-time-server branch 3 times, most recently from 369e7c6 to 011a65c Compare February 12, 2026 08:46
Implements #2783. A configurable-latency Go MCP server modelled on
fast-time-server that introduces artificial delays on every tool call,
serving as a testing target for gateway timeout enforcement, circuit
breaker behaviour, session pool resilience, and load testing.

Server features:
- 5 MCP tools: get_slow_time, convert_slow_time, get_instant_time,
  get_timeout_time, get_flaky_time
- 2 MCP resources: latency://config, latency://stats
- 1 MCP prompt: test_timeout
- 4 latency distributions: fixed, uniform, normal, exponential
- Failure simulation with configurable rate and mode
- Runtime reconfiguration via REST POST /api/v1/config
- Invocation statistics with p50/p95/p99 percentiles
- Multi-transport: stdio, SSE, Streamable HTTP, dual, REST
- 32 unit tests with race detection, all passing

Integration:
- docker-compose.yml: testing profile (port 8889) + auto-registration
- docker-compose-performance.yml: dedicated performance testing service
- Locust load test with 4 scenarios (slow, timeout storm, mixed, circuit breaker)
- Documentation in docs/docs/using/servers/go/slow-time-server.md

Closes #2783

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
- Fix healthcheck in docker-compose-performance.yml to use binary's
  built-in health check instead of curl (scratch image has no curl)
- Replace mixed atomic+mutex with plain increments under mutex in
  invocationStats.record() for clarity
- Remove dead generateTestTimeoutPrompt() function and unused strings
  import from rest_handlers.go
- Remove unused json and uuid imports from locust test file
- Align env var naming (SLOW_TIME_LATENCY) between compose files

Closes #2783

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
@crivetimihai
Copy link
Copy Markdown
Member Author

Review & Rebase

Rebased onto main (clean, no conflicts) and applied the following fixes:

Bug fix

  • docker-compose-performance.yml healthcheck: Was using curl but the image is scratch-based (no curl). Switched to the binary's built-in -health flag, matching docker-compose.yml.

Code cleanup

  • Mixed atomic+mutex in invocationStats.record(): Replaced redundant atomic.AddInt64 with plain increments under the mutex for clarity — both record() and snapshot() always hold the lock.
  • Dead code: Removed unused generateTestTimeoutPrompt() from rest_handlers.go (the prompt is handled by handleTestTimeoutPrompt in main.go). Also removed the now-unused strings import.
  • Unused imports: Removed json and uuid from locustfile_slow_time_server.py.
  • Env var naming: Aligned SLOW_TIME_DEFAULT_LATENCYSLOW_TIME_LATENCY in docker-compose-performance.yml to match docker-compose.yml.

Verification

  • go vet ./... — clean
  • go test -race -timeout=90s ./... — 32/32 pass
  • Both compose files validate (docker compose config --services)

The slow-time-server deliberately introduces latency and failures,
which breaks existing tests when included in the testing profile.
Move it to a dedicated 'resilience' profile so it must be explicitly
opted into.

- docker-compose.yml: profiles ["testing"] -> ["resilience"]
- Makefile: add resilience-up/down/logs targets
- docs: update profile references

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
@crivetimihai
Copy link
Copy Markdown
Member Author

Profile isolation

Moved slow_time_server and register_slow_time from the testing profile to a dedicated resilience profile. This prevents the slow-time-server (which deliberately introduces latency and failures) from breaking existing tests that use --profile testing.

Before: docker compose --profile testing up -d starts the slow-time-server and registers its tools with the gateway.

After: Slow-time-server requires explicit opt-in:

# Resilience testing only
docker compose --profile resilience up -d

# Or combine with testing
docker compose --profile testing --profile resilience up -d

Also added Makefile targets: make resilience-up, make resilience-down, make resilience-logs.

Add dedicated targets for running Locust and JMeter tests against
the slow-time-server, ensuring these tests only run when explicitly
invoked rather than as part of the regular testing profile.

New targets:
- resilience-locust: headless Locust run (10 users, 120s)
- resilience-locust-ui: Locust web UI on port 8090
- resilience-jmeter: JMeter baseline (20 threads, 5min)

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
@crivetimihai crivetimihai merged commit 8bc2995 into main Feb 15, 2026
40 of 41 checks passed
@crivetimihai crivetimihai deleted the slow-time-server branch February 15, 2026 15:02
suciu-daniel pushed a commit that referenced this pull request Feb 16, 2026
…2865)

* feat: add slow-time-server for timeout, resilience, and load testing

Implements #2783. A configurable-latency Go MCP server modelled on
fast-time-server that introduces artificial delays on every tool call,
serving as a testing target for gateway timeout enforcement, circuit
breaker behaviour, session pool resilience, and load testing.

Server features:
- 5 MCP tools: get_slow_time, convert_slow_time, get_instant_time,
  get_timeout_time, get_flaky_time
- 2 MCP resources: latency://config, latency://stats
- 1 MCP prompt: test_timeout
- 4 latency distributions: fixed, uniform, normal, exponential
- Failure simulation with configurable rate and mode
- Runtime reconfiguration via REST POST /api/v1/config
- Invocation statistics with p50/p95/p99 percentiles
- Multi-transport: stdio, SSE, Streamable HTTP, dual, REST
- 32 unit tests with race detection, all passing

Integration:
- docker-compose.yml: testing profile (port 8889) + auto-registration
- docker-compose-performance.yml: dedicated performance testing service
- Locust load test with 4 scenarios (slow, timeout storm, mixed, circuit breaker)
- Documentation in docs/docs/using/servers/go/slow-time-server.md

Closes #2783

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* fix: address review issues in slow-time-server PR

- Fix healthcheck in docker-compose-performance.yml to use binary's
  built-in health check instead of curl (scratch image has no curl)
- Replace mixed atomic+mutex with plain increments under mutex in
  invocationStats.record() for clarity
- Remove dead generateTestTimeoutPrompt() function and unused strings
  import from rest_handlers.go
- Remove unused json and uuid imports from locust test file
- Align env var naming (SLOW_TIME_LATENCY) between compose files

Closes #2783

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* fix: move slow-time-server to dedicated resilience profile

The slow-time-server deliberately introduces latency and failures,
which breaks existing tests when included in the testing profile.
Move it to a dedicated 'resilience' profile so it must be explicitly
opted into.

- docker-compose.yml: profiles ["testing"] -> ["resilience"]
- Makefile: add resilience-up/down/logs targets
- docs: update profile references

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* feat: add Makefile targets for resilience load testing

Add dedicated targets for running Locust and JMeter tests against
the slow-time-server, ensuring these tests only run when explicitly
invoked rather than as part of the regular testing profile.

New targets:
- resilience-locust: headless Locust run (10 users, 120s)
- resilience-locust-ui: Locust web UI on port 8090
- resilience-jmeter: JMeter baseline (20 threads, 5min)

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

---------

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
vishu-bh pushed a commit that referenced this pull request Feb 18, 2026
…2865)

* feat: add slow-time-server for timeout, resilience, and load testing

Implements #2783. A configurable-latency Go MCP server modelled on
fast-time-server that introduces artificial delays on every tool call,
serving as a testing target for gateway timeout enforcement, circuit
breaker behaviour, session pool resilience, and load testing.

Server features:
- 5 MCP tools: get_slow_time, convert_slow_time, get_instant_time,
  get_timeout_time, get_flaky_time
- 2 MCP resources: latency://config, latency://stats
- 1 MCP prompt: test_timeout
- 4 latency distributions: fixed, uniform, normal, exponential
- Failure simulation with configurable rate and mode
- Runtime reconfiguration via REST POST /api/v1/config
- Invocation statistics with p50/p95/p99 percentiles
- Multi-transport: stdio, SSE, Streamable HTTP, dual, REST
- 32 unit tests with race detection, all passing

Integration:
- docker-compose.yml: testing profile (port 8889) + auto-registration
- docker-compose-performance.yml: dedicated performance testing service
- Locust load test with 4 scenarios (slow, timeout storm, mixed, circuit breaker)
- Documentation in docs/docs/using/servers/go/slow-time-server.md

Closes #2783

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* fix: address review issues in slow-time-server PR

- Fix healthcheck in docker-compose-performance.yml to use binary's
  built-in health check instead of curl (scratch image has no curl)
- Replace mixed atomic+mutex with plain increments under mutex in
  invocationStats.record() for clarity
- Remove dead generateTestTimeoutPrompt() function and unused strings
  import from rest_handlers.go
- Remove unused json and uuid imports from locust test file
- Align env var naming (SLOW_TIME_LATENCY) between compose files

Closes #2783

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* fix: move slow-time-server to dedicated resilience profile

The slow-time-server deliberately introduces latency and failures,
which breaks existing tests when included in the testing profile.
Move it to a dedicated 'resilience' profile so it must be explicitly
opted into.

- docker-compose.yml: profiles ["testing"] -> ["resilience"]
- Makefile: add resilience-up/down/logs targets
- docs: update profile references

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* feat: add Makefile targets for resilience load testing

Add dedicated targets for running Locust and JMeter tests against
the slow-time-server, ensuring these tests only run when explicitly
invoked rather than as part of the regular testing profile.

New targets:
- resilience-locust: headless Locust run (10 users, 120s)
- resilience-locust-ui: Locust web UI on port 8090
- resilience-jmeter: JMeter baseline (20 threads, 5min)

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

---------

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Signed-off-by: Vishu Bhatnagar <vishu.bhatnagar@ibm.com>
kcostell06 pushed a commit to kcostell06/mcp-context-forge that referenced this pull request Feb 24, 2026
…BM#2865)

* feat: add slow-time-server for timeout, resilience, and load testing

Implements IBM#2783. A configurable-latency Go MCP server modelled on
fast-time-server that introduces artificial delays on every tool call,
serving as a testing target for gateway timeout enforcement, circuit
breaker behaviour, session pool resilience, and load testing.

Server features:
- 5 MCP tools: get_slow_time, convert_slow_time, get_instant_time,
  get_timeout_time, get_flaky_time
- 2 MCP resources: latency://config, latency://stats
- 1 MCP prompt: test_timeout
- 4 latency distributions: fixed, uniform, normal, exponential
- Failure simulation with configurable rate and mode
- Runtime reconfiguration via REST POST /api/v1/config
- Invocation statistics with p50/p95/p99 percentiles
- Multi-transport: stdio, SSE, Streamable HTTP, dual, REST
- 32 unit tests with race detection, all passing

Integration:
- docker-compose.yml: testing profile (port 8889) + auto-registration
- docker-compose-performance.yml: dedicated performance testing service
- Locust load test with 4 scenarios (slow, timeout storm, mixed, circuit breaker)
- Documentation in docs/docs/using/servers/go/slow-time-server.md

Closes IBM#2783

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* fix: address review issues in slow-time-server PR

- Fix healthcheck in docker-compose-performance.yml to use binary's
  built-in health check instead of curl (scratch image has no curl)
- Replace mixed atomic+mutex with plain increments under mutex in
  invocationStats.record() for clarity
- Remove dead generateTestTimeoutPrompt() function and unused strings
  import from rest_handlers.go
- Remove unused json and uuid imports from locust test file
- Align env var naming (SLOW_TIME_LATENCY) between compose files

Closes IBM#2783

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* fix: move slow-time-server to dedicated resilience profile

The slow-time-server deliberately introduces latency and failures,
which breaks existing tests when included in the testing profile.
Move it to a dedicated 'resilience' profile so it must be explicitly
opted into.

- docker-compose.yml: profiles ["testing"] -> ["resilience"]
- Makefile: add resilience-up/down/logs targets
- docs: update profile references

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* feat: add Makefile targets for resilience load testing

Add dedicated targets for running Locust and JMeter tests against
the slow-time-server, ensuring these tests only run when explicitly
invoked rather than as part of the regular testing profile.

New targets:
- resilience-locust: headless Locust run (10 users, 120s)
- resilience-locust-ui: Locust web UI on port 8090
- resilience-jmeter: JMeter baseline (20 threads, 5min)

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

---------

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mcp-servers MCP Server Samples test-automation Automated testing testing Testing (unit, e2e, manual, automated, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[EPIC][TESTING]: Slow Time Server - configurable-latency MCP server for timeout, resilience, and load testing

1 participant