mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
Refactor E2E port registration (#10306)
* Refactor e2e port registration * uncomment tests * explain calculation * fix things * change param to pointer * fix errors * unit test and constant
This commit is contained in:
@@ -201,12 +201,12 @@ func LogErrorOutput(t *testing.T, file io.Reader, title string, index int) {
|
||||
|
||||
// WritePprofFiles writes the memory heap and cpu profile files to the test path.
|
||||
func WritePprofFiles(testDir string, index int) error {
|
||||
url := fmt.Sprintf("http://127.0.0.1:%d/debug/pprof/heap", e2e.TestParams.BeaconNodeRPCPort+50+index)
|
||||
url := fmt.Sprintf("http://127.0.0.1:%d/debug/pprof/heap", e2e.TestParams.Ports.PrysmBeaconNodePprofPort+index)
|
||||
filePath := filepath.Join(testDir, fmt.Sprintf(memoryHeapFileName, index))
|
||||
if err := writeURLRespAtPath(url, filePath); err != nil {
|
||||
return err
|
||||
}
|
||||
url = fmt.Sprintf("http://127.0.0.1:%d/debug/pprof/profile", e2e.TestParams.BeaconNodeRPCPort+50+index)
|
||||
url = fmt.Sprintf("http://127.0.0.1:%d/debug/pprof/profile", e2e.TestParams.Ports.PrysmBeaconNodePprofPort+index)
|
||||
filePath = filepath.Join(testDir, fmt.Sprintf(cpuProfileFileName, index))
|
||||
return writeURLRespAtPath(url, filePath)
|
||||
}
|
||||
@@ -255,7 +255,7 @@ func NewLocalConnection(ctx context.Context, port int) (*grpc.ClientConn, error)
|
||||
func NewLocalConnections(ctx context.Context, numConns int) ([]*grpc.ClientConn, func(), error) {
|
||||
conns := make([]*grpc.ClientConn, numConns)
|
||||
for i := 0; i < len(conns); i++ {
|
||||
conn, err := NewLocalConnection(ctx, e2e.TestParams.BeaconNodeRPCPort+i)
|
||||
conn, err := NewLocalConnection(ctx, e2e.TestParams.Ports.PrysmBeaconNodeRPCPort+i)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user