(t *testing.T)
| 119 | } |
| 120 | |
| 121 | func TestDrain_Train_MinTokensEnforcement(t *testing.T) { |
| 122 | t.Parallel() |
| 123 | |
| 124 | config := DefaultConfig() |
| 125 | config.MinTokens = 3 // Need at least 3 tokens |
| 126 | drain := New("test-tenant", config) |
| 127 | |
| 128 | // Span name that will tokenize to less than MinTokens |
| 129 | // Single character will tokenize to ["a", "<END>"] which is 2 tokens < 3 |
| 130 | cluster := drain.Train("a") |
| 131 | require.Nil(t, cluster, "should return nil for span with too few tokens") |
| 132 | |
| 133 | // Valid span name should work |
| 134 | cluster = drain.Train("GET /api/users") |
| 135 | require.NotNil(t, cluster, "should accept valid span name") |
| 136 | } |
| 137 | |
| 138 | func TestDrain_Train_MaxTokensEnforcement(t *testing.T) { |
| 139 | t.Parallel() |
nothing calls this directly
no test coverage detected