(t *testing.T)
| 136 | } |
| 137 | |
| 138 | func TestDrain_Train_MaxTokensEnforcement(t *testing.T) { |
| 139 | t.Parallel() |
| 140 | |
| 141 | config := DefaultConfig() |
| 142 | config.MaxTokens = 3 // Very small limit for testing (tokenizer produces many tokens) |
| 143 | drain := New("test-tenant", config) |
| 144 | |
| 145 | // Create a span name that will exceed MaxTokens |
| 146 | // "GET /api/users" tokenizes to ["GET", " ", "/", "api", "/", "users", "<END>"] = 7 tokens |
| 147 | longSpanName := "GET /api/users/123/posts/456/comments/789/tags/101/items/202/details/303" |
| 148 | cluster := drain.Train(longSpanName) |
| 149 | require.Nil(t, cluster, "should return nil for span with too many tokens") |
| 150 | } |
| 151 | |
| 152 | func TestDrain_Train_EmptyString(t *testing.T) { |
| 153 | t.Parallel() |
nothing calls this directly
no test coverage detected