Skip to content

Add unit tests for Smart Router scoring algorithm #1

Description

@depadeto

Context

The Smart Router (control-plane/smart-router/main.go) uses a 4-signal scoring algorithm (KV cache, session affinity, load, latency) to pick the best cluster for each request.

Task

Add Go unit tests for the scoreCluster() function covering:

  • Cache hit vs miss scoring
  • Session pinned vs unpinned
  • Different load ratios (0%, 50%, 100%)
  • Latency scoring edge cases
  • Combined scoring with different weights

Files

  • control-plane/smart-router/main.go — the code to test
  • Create control-plane/smart-router/main_test.go

Getting started

cd control-plane/smart-router
go test -v ./...

Good first issue — straightforward Go testing, no infrastructure needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions