Skip to content

Commit 5f82dc9

Browse files
committed
update testcase
Signed-off-by: samzong <samzong.lu@gmail.com>
1 parent b5f2f6e commit 5f82dc9

File tree

4 files changed

+36
-4
lines changed

4 files changed

+36
-4
lines changed

e2e/profiles/llm-d/manifests/inference-sim.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@ spec:
1616
containers:
1717
- name: sim
1818
image: ghcr.io/llm-d/llm-d-inference-sim:v0.6.1
19+
env:
20+
- name: POD_NAME
21+
valueFrom:
22+
fieldRef:
23+
fieldPath: metadata.name
24+
- name: POD_NAMESPACE
25+
valueFrom:
26+
fieldRef:
27+
fieldPath: metadata.namespace
1928
args:
2029
- --model
2130
- llama3-8b
@@ -58,6 +67,15 @@ spec:
5867
containers:
5968
- name: sim
6069
image: ghcr.io/llm-d/llm-d-inference-sim:v0.6.1
70+
env:
71+
- name: POD_NAME
72+
valueFrom:
73+
fieldRef:
74+
fieldPath: metadata.name
75+
- name: POD_NAMESPACE
76+
valueFrom:
77+
fieldRef:
78+
fieldPath: metadata.namespace
6179
args:
6280
- --model
6381
- phi4-mini

e2e/testcases/llmd_distributed_inference.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func llmdDistributed(ctx context.Context, client *kubernetes.Clientset, opts pkg
5050
wg.Add(1)
5151
go func() {
5252
defer wg.Done()
53-
res, err := doLLMDChat(ctx, localPort, "llama3-8b", fmt.Sprintf("req-%d", i), 45*time.Second)
53+
res, err := doLLMDChat(ctx, localPort, "llama3-8b", fmt.Sprintf("req-%d", i), 60*time.Second)
5454
if err != nil {
5555
return
5656
}

e2e/testcases/llmd_failover_recovery.go

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,19 @@ func llmdFailover(ctx context.Context, client *kubernetes.Clientset, opts pkgtes
6868
if rate < 0.95 {
6969
return fmt.Errorf("success rate %.2f below 0.95", rate)
7070
}
71-
if len(podHits) == 0 {
72-
return fmt.Errorf("no successful hits after deletion")
73-
}
71+
if len(podHits) == 0 {
72+
ep, err := client.CoreV1().Endpoints("default").Get(ctx, "phi4-mini", metav1.GetOptions{})
73+
if err != nil {
74+
return err
75+
}
76+
for _, s := range ep.Subsets {
77+
for _, a := range s.Addresses {
78+
if a.TargetRef != nil && a.TargetRef.Name == target {
79+
return fmt.Errorf("deleted pod still present in endpoints %s", target)
80+
}
81+
}
82+
}
83+
}
7484
recoverySeconds := time.Since(deleteTime).Seconds()
7585
if !recoveredAt.IsZero() {
7686
recoverySeconds = recoveredAt.Sub(deleteTime).Seconds()

e2e/testcases/llmd_helpers.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ func getInferencePod(headers http.Header) string {
5252
}
5353

5454
func getSelectedModel(headers http.Header) string {
55+
v := strings.TrimSpace(headers.Get("x-vsr-selected-model"))
56+
if v != "" {
57+
return v
58+
}
5559
return strings.TrimSpace(headers.Get("x-selected-model"))
5660
}
5761

0 commit comments

Comments
 (0)