[PR #5226] [MERGED] test/e2e: replace RunProcesses client sleep with log-based proxy readiness detection #5190

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/5226
Author: @fatedier
Created: 3/9/2026
Status: Merged
Merged: 3/9/2026
Merged by: @fatedier

Base: devHead: new


📝 Commits (2)

  • adcd2e6 test/e2e: replace RunProcesses client sleep with log-based proxy readiness detection
  • 01413c3 test/e2e: use shared deadline for proxy readiness and fix doc comment

📊 Changes

2 files changed (+91 additions, -7 deletions)

View changed files

📝 test/e2e/framework/process.go (+42 -3)
📝 test/e2e/pkg/process/process.go (+49 -4)

📄 Description

Summary

  • Replace the fixed time.Sleep(1500ms) in RunProcesses with event-driven proxy registration detection by monitoring frpc log output for "start proxy success" messages
  • Add thread-safe SafeBuffer to Process struct, enabling concurrent read/write of process output during execution
  • Add Process.WaitForOutput() method to poll output with timeout and early exit on process termination
  • Add waitForClientProxyReady() that uses config.LoadClientConfig() to extract proxy names, then waits for each proxy's success log
  • For visitor-only clients (no deterministic readiness signal), fall back to the original sleep with elapsed time deducted

This approach is universal across all proxy types (TCP/UDP/HTTP/HTTPS/STCP/SUDP/XTCP/TCPMUX) since every proxy logs the same success message on registration.

Test plan

  • go build ./... passes
  • golangci-lint run passes
  • make e2e passes (225/225, 3 consecutive runs)
  • Verified visitor-only clients (STCP/XTCP tests) still get fallback sleep
  • Verified proxy registration failure correctly falls back to sleep

🔄 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/5226 **Author:** [@fatedier](https://github.com/fatedier) **Created:** 3/9/2026 **Status:** ✅ Merged **Merged:** 3/9/2026 **Merged by:** [@fatedier](https://github.com/fatedier) **Base:** `dev` ← **Head:** `new` --- ### 📝 Commits (2) - [`adcd2e6`](https://github.com/fatedier/frp/commit/adcd2e64b6e3776d137accd1eca5f480dbe2251f) test/e2e: replace RunProcesses client sleep with log-based proxy readiness detection - [`01413c3`](https://github.com/fatedier/frp/commit/01413c385304ea1a20a0e665c4cfbb3757113535) test/e2e: use shared deadline for proxy readiness and fix doc comment ### 📊 Changes **2 files changed** (+91 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `test/e2e/framework/process.go` (+42 -3) 📝 `test/e2e/pkg/process/process.go` (+49 -4) </details> ### 📄 Description ## Summary - Replace the fixed `time.Sleep(1500ms)` in `RunProcesses` with event-driven proxy registration detection by monitoring frpc log output for `"start proxy success"` messages - Add thread-safe `SafeBuffer` to `Process` struct, enabling concurrent read/write of process output during execution - Add `Process.WaitForOutput()` method to poll output with timeout and early exit on process termination - Add `waitForClientProxyReady()` that uses `config.LoadClientConfig()` to extract proxy names, then waits for each proxy's success log - For visitor-only clients (no deterministic readiness signal), fall back to the original sleep with elapsed time deducted This approach is universal across all proxy types (TCP/UDP/HTTP/HTTPS/STCP/SUDP/XTCP/TCPMUX) since every proxy logs the same success message on registration. ## Test plan - [x] `go build ./...` passes - [x] `golangci-lint run` passes - [x] `make e2e` passes (225/225, 3 consecutive runs) - [x] Verified visitor-only clients (STCP/XTCP tests) still get fallback sleep - [x] Verified proxy registration failure correctly falls back to sleep --- <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#5190
No description provided.