[PR #5225] [MERGED] test/e2e: optimize RunFrps/RunFrpc with process exit detection #5189

Closed
opened 2026-05-05 14:56:25 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/fatedier/frp/pull/5225
Author: @fatedier
Created: 3/8/2026
Status: Merged
Merged: 3/9/2026
Merged by: @fatedier

Base: devHead: new


📝 Commits (2)

  • f32bec9 test/e2e: optimize RunFrps/RunFrpc with process exit detection
  • 8d1ab7d test/e2e: guard Process against double-Start and Stop-before-Start

📊 Changes

2 files changed (+44 additions, -5 deletions)

View changed files

📝 test/e2e/framework/process.go (+8 -2)
📝 test/e2e/pkg/process/process.go (+36 -3)

📄 Description

Summary

  • Refactor Process to track subprocess lifecycle via a done channel, ensuring cmd.Wait() is called exactly once and eliminating double-Wait races
  • Replace fixed time.Sleep in RunFrps/RunFrpc with select on the done channel, so short-lived processes (verify commands, startup failures) return immediately instead of waiting the full 2s/1.5s timeout
  • Zero API or behavior change for all 38 call sites

Test plan

  • go build ./... passes
  • golangci-lint run passes
  • Full e2e test suite passes (227 specs, 37.6s)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/fatedier/frp/pull/5225 **Author:** [@fatedier](https://github.com/fatedier) **Created:** 3/8/2026 **Status:** ✅ Merged **Merged:** 3/9/2026 **Merged by:** [@fatedier](https://github.com/fatedier) **Base:** `dev` ← **Head:** `new` --- ### 📝 Commits (2) - [`f32bec9`](https://github.com/fatedier/frp/commit/f32bec9f4d3da9eaf821044141341fcc14834395) test/e2e: optimize RunFrps/RunFrpc with process exit detection - [`8d1ab7d`](https://github.com/fatedier/frp/commit/8d1ab7d585200fb21bd03a4d4635707c6a2002bd) test/e2e: guard Process against double-Start and Stop-before-Start ### 📊 Changes **2 files changed** (+44 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `test/e2e/framework/process.go` (+8 -2) 📝 `test/e2e/pkg/process/process.go` (+36 -3) </details> ### 📄 Description ## Summary - Refactor `Process` to track subprocess lifecycle via a `done` channel, ensuring `cmd.Wait()` is called exactly once and eliminating double-Wait races - Replace fixed `time.Sleep` in `RunFrps`/`RunFrpc` with `select` on the done channel, so short-lived processes (verify commands, startup failures) return immediately instead of waiting the full 2s/1.5s timeout - Zero API or behavior change for all 38 call sites ## Test plan - [x] `go build ./...` passes - [x] `golangci-lint run` passes - [x] Full e2e test suite passes (227 specs, 37.6s) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 14:56:25 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#5189
No description provided.