@@ -3,7 +3,6 @@ package hivesim
33import (
44 "context"
55 "fmt"
6- "io"
76 "net"
87 "os"
98 "runtime"
@@ -232,9 +231,9 @@ type Client struct {
232231 test * T
233232
234233 // Fields for shared client support
235- IsShared bool // Whether this client is shared across tests
236- LogPosition int64 // Current position in the log file (for shared clients)
237- SuiteID SuiteID // The suite this client belongs to (for shared clients)
234+ IsShared bool // Whether this client is shared across tests
235+ LogPosition int64 // Current position in the log file (for shared clients)
236+ SuiteID SuiteID // The suite this client belongs to (for shared clients)
238237}
239238
240239// EnodeURL returns the default peer-to-peer endpoint of the client.
@@ -347,7 +346,7 @@ func (t *T) GetSharedClient(clientID string) *Client {
347346 // Use the position from the client object as a fallback
348347 currentLogPosition = sharedClient .LogPosition
349348 }
350-
349+
351350 // Store the test context in the client so it can be used for this test
352351 // Create a new Client instance that points to the same container
353352 client := & Client {
@@ -373,25 +372,7 @@ func (t *T) GetSharedClient(clientID string) *Client {
373372
374373 t .Logf ("Using shared client %s with log position %d" , clientID , currentLogPosition )
375374
376- // Register this shared client with the test using the startClient endpoint with a special parameter
377- // This makes it appear in the test's ClientInfo so the UI can display the logs correctly
378- var (
379- config = simapi.NodeConfig {
380- Client : sharedClient .Type ,
381- SharedClientID : clientID ,
382- }
383- )
384-
385- // Set up a client setup object to post with files (even though we don't have any files)
386- setup := & clientSetup {
387- files : make (map [string ]func () (io.ReadCloser , error )),
388- config : config ,
389- }
390-
391- url := fmt .Sprintf ("%s/testsuite/%d/test/%d/node" , t .Sim .url , t .SuiteID , t .TestID )
392- var resp simapi.StartNodeResponse
393- err = setup .postWithFiles (url , & resp )
394- if err != nil {
375+ if err := t .Sim .RegisterNode (t .SuiteID , t .TestID , clientID ); err != nil {
395376 t .Logf ("Warning: Failed to register shared client %s with test: %v" , clientID , err )
396377 } else {
397378 t .Logf ("Successfully registered shared client %s with test %d" , clientID , t .TestID )
@@ -524,9 +505,9 @@ func runTest(host *Simulation, test testSpec, runit func(t *T)) error {
524505
525506 // Register test on simulation server and initialize the T.
526507 t := & T {
527- Sim : host ,
528- SuiteID : test .suiteID ,
529- suite : test .suite ,
508+ Sim : host ,
509+ SuiteID : test .suiteID ,
510+ suite : test .suite ,
530511 clientLogOffsets : make (map [string ]* LogOffset ), // Initialize log offset tracking
531512 }
532513 testID , err := host .StartTest (test .suiteID , test .request ())
0 commit comments