[PR #5223] [MERGED] test/e2e: optimize e2e test time with TCP readiness checks #5188

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

📋 Pull Request Information

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

Base: devHead: new


📝 Commits (1)

  • b64c5a8 test/e2e: optimize e2e test time by replacing sleeps with TCP readiness checks

📊 Changes

37 files changed (+225 additions, -192 deletions)

View changed files

📝 test/e2e/examples.go (+1 -1)
📝 test/e2e/framework/process.go (+61 -37)
📝 test/e2e/legacy/basic/basic.go (+5 -5)
📝 test/e2e/legacy/basic/client.go (+3 -3)
📝 test/e2e/legacy/basic/client_server.go (+1 -1)
📝 test/e2e/legacy/basic/config.go (+1 -1)
📝 test/e2e/legacy/basic/http.go (+8 -8)
📝 test/e2e/legacy/basic/server.go (+4 -4)
📝 test/e2e/legacy/basic/tcpmux.go (+3 -3)
📝 test/e2e/legacy/basic/xtcp.go (+1 -1)
📝 test/e2e/legacy/features/bandwidth_limit.go (+2 -2)
📝 test/e2e/legacy/features/group.go (+3 -3)
📝 test/e2e/legacy/features/heartbeat.go (+1 -1)
📝 test/e2e/legacy/features/monitor.go (+1 -1)
📝 test/e2e/legacy/features/real_ip.go (+3 -3)
📝 test/e2e/legacy/plugin/client.go (+7 -7)
📝 test/e2e/legacy/plugin/server.go (+8 -8)
📝 test/e2e/pkg/process/process.go (+4 -0)
📝 test/e2e/v1/basic/annotations.go (+1 -1)
📝 test/e2e/v1/basic/basic.go (+5 -5)

...and 17 more files

📄 Description

Summary

  • Replace hardcoded time.Sleep in RunProcesses with TCP dial-based readiness detection for frps startup, using the port from the framework's existing allocation map (ports[consts.PortServerName])
  • Simplify RunProcesses signature: serverTemplates []stringserverTemplate string, since all callers pass exactly one server config
  • Reduce sleep durations in RunFrps (4s→2s) and RunFrpc (2s→1.5s)

Before: ~97s average → After: ~41s average (~57% reduction)

Test plan

  • go build ./test/e2e/... passes
  • go vet ./... passes
  • make e2e passes 3 consecutive runs (225/225 tests, 0 failures)
  • No changes to test/e2e/pkg/process/process.go (generic process package untouched)

🔄 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/5223 **Author:** [@fatedier](https://github.com/fatedier) **Created:** 3/8/2026 **Status:** ✅ Merged **Merged:** 3/8/2026 **Merged by:** [@fatedier](https://github.com/fatedier) **Base:** `dev` ← **Head:** `new` --- ### 📝 Commits (1) - [`b64c5a8`](https://github.com/fatedier/frp/commit/b64c5a82b27d86c3f3e9f824b3a3e0af082eba8e) test/e2e: optimize e2e test time by replacing sleeps with TCP readiness checks ### 📊 Changes **37 files changed** (+225 additions, -192 deletions) <details> <summary>View changed files</summary> 📝 `test/e2e/examples.go` (+1 -1) 📝 `test/e2e/framework/process.go` (+61 -37) 📝 `test/e2e/legacy/basic/basic.go` (+5 -5) 📝 `test/e2e/legacy/basic/client.go` (+3 -3) 📝 `test/e2e/legacy/basic/client_server.go` (+1 -1) 📝 `test/e2e/legacy/basic/config.go` (+1 -1) 📝 `test/e2e/legacy/basic/http.go` (+8 -8) 📝 `test/e2e/legacy/basic/server.go` (+4 -4) 📝 `test/e2e/legacy/basic/tcpmux.go` (+3 -3) 📝 `test/e2e/legacy/basic/xtcp.go` (+1 -1) 📝 `test/e2e/legacy/features/bandwidth_limit.go` (+2 -2) 📝 `test/e2e/legacy/features/group.go` (+3 -3) 📝 `test/e2e/legacy/features/heartbeat.go` (+1 -1) 📝 `test/e2e/legacy/features/monitor.go` (+1 -1) 📝 `test/e2e/legacy/features/real_ip.go` (+3 -3) 📝 `test/e2e/legacy/plugin/client.go` (+7 -7) 📝 `test/e2e/legacy/plugin/server.go` (+8 -8) 📝 `test/e2e/pkg/process/process.go` (+4 -0) 📝 `test/e2e/v1/basic/annotations.go` (+1 -1) 📝 `test/e2e/v1/basic/basic.go` (+5 -5) _...and 17 more files_ </details> ### 📄 Description ## Summary - Replace hardcoded `time.Sleep` in `RunProcesses` with TCP dial-based readiness detection for frps startup, using the port from the framework's existing allocation map (`ports[consts.PortServerName]`) - Simplify `RunProcesses` signature: `serverTemplates []string` → `serverTemplate string`, since all callers pass exactly one server config - Reduce sleep durations in `RunFrps` (4s→2s) and `RunFrpc` (2s→1.5s) **Before: ~97s average → After: ~41s average (~57% reduction)** ## Test plan - [x] `go build ./test/e2e/...` passes - [x] `go vet ./...` passes - [x] `make e2e` passes 3 consecutive runs (225/225 tests, 0 failures) - [x] No changes to `test/e2e/pkg/process/process.go` (generic process package untouched) --- <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:20 -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#5188
No description provided.