[E2E] Staging API Integration Tests 秒挂 - 容器内npm ci可能失败 #1275

Closed
opened 2026-08-07 19:49:55 +08:00 by xiaoxia · 0 comments
Owner

问题描述

CI 的 Staging API Integration Tests 每次都在 0 秒内完成并失败(秒挂),整个 job 只跑 16 秒。

根因(已确认)

通过 Gitea Actions runner 日志确认:

Error response from daemon: Conflict. The container name "/staging-api-tests-38" is already in use by container "e243227..."

CI 容器内 PID 固定为 38,每次创建的容器名都是 staging-api-tests-38。上一次失败后 set -eu 直接退出,没有执行到末尾的 docker rm,残留容器导致下次 docker create 立即因同名冲突失败。

E2E job 有 docker rm -f 清理步骤所以没这个问题,API Tests job 漏了这个步骤。

修复

PR #1278 已合并到 develop:

  1. staging-api-tests 在 docker create 前加 docker rm -f 清理残留容器
  2. 两个 staging job 都删除了无效的 docker cp package-lock.json 行(根目录无此文件)
## 问题描述 CI 的 Staging API Integration Tests 每次都在 0 秒内完成并失败(秒挂),整个 job 只跑 16 秒。 ## 根因(已确认) 通过 Gitea Actions runner 日志确认: ``` Error response from daemon: Conflict. The container name "/staging-api-tests-38" is already in use by container "e243227..." ``` CI 容器内 PID 固定为 38,每次创建的容器名都是 `staging-api-tests-38`。上一次失败后 `set -eu` 直接退出,没有执行到末尾的 `docker rm`,残留容器导致下次 `docker create` 立即因同名冲突失败。 E2E job 有 `docker rm -f` 清理步骤所以没这个问题,API Tests job 漏了这个步骤。 ## 修复 PR #1278 已合并到 develop: 1. staging-api-tests 在 `docker create` 前加 `docker rm -f` 清理残留容器 2. 两个 staging job 都删除了无效的 `docker cp package-lock.json` 行(根目录无此文件)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: xiaoxia/xiaoxia-saas#1275