Commit Graph

6 Commits

  • test/e2e: replace sleeps with event-driven waits in chaos/group/store tests (#5231)
    * test/e2e: replace sleeps with event-driven waits in chaos/group/store tests
    
    Replace 21 time.Sleep calls with deterministic waiting using
    WaitForOutput, WaitForTCPReady, and a new WaitForTCPUnreachable helper.
    Add CountOutput method for snapshot-based incremental log matching.
    
    * test/e2e: validate interval and cap dial/sleep to remaining deadline in WaitForTCPUnreachable
  • test/e2e: optimize e2e test time by replacing sleeps with TCP readiness checks (#5223)
    Replace the fixed 500ms sleep after each frps startup in RunProcesses
    with a TCP dial-based readiness check that polls the server bind port.
    This reduces the e2e suite wall time from ~97s to ~43s.
    
    Also simplify the RunProcesses API to accept a single server template
    string instead of a slice, matching how every call site uses it.
  • server/group: refactor with shared abstractions and fix concurrency issues (#5222)
    * server/group: refactor group package with shared abstractions and fix concurrency issues
    
    Extract common patterns into reusable components:
    - groupRegistry[G]: generic concurrent map for group lifecycle management
    - baseGroup: shared plumbing for listener-based groups (TCP, HTTPS, TCPMux)
    - Listener: unified virtual listener replacing 3 identical implementations
    
    Fix concurrency issues:
    - Stale-pointer race: isCurrent check + errGroupStale + controller retry loops
    - Worker generation safety: pass realLn and acceptCh as params instead of reading mutable fields
    - Connection leak: close conn on worker panic recovery path
    - ABBA deadlock in HTTP UnRegister: consistent lock ordering (group.mu -> registry.mu)
    - Round-robin overflow in HTTPGroup: use unsigned modulo
    
    Add unit tests (17 tests) for registry, listener, and baseGroup.
    Add TCPMux group load balancing e2e test.
    
    * server/group: replace tautological assertion with require.NotPanics
    
    * server/group: remove blank line between doc comment and type declaration