@@ -3,7 +3,6 @@ package hivesim
3
3
import (
4
4
"context"
5
5
"fmt"
6
- "io"
7
6
"net"
8
7
"os"
9
8
"runtime"
@@ -232,9 +231,9 @@ type Client struct {
232
231
test * T
233
232
234
233
// 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)
238
237
}
239
238
240
239
// EnodeURL returns the default peer-to-peer endpoint of the client.
@@ -347,7 +346,7 @@ func (t *T) GetSharedClient(clientID string) *Client {
347
346
// Use the position from the client object as a fallback
348
347
currentLogPosition = sharedClient .LogPosition
349
348
}
350
-
349
+
351
350
// Store the test context in the client so it can be used for this test
352
351
// Create a new Client instance that points to the same container
353
352
client := & Client {
@@ -373,25 +372,7 @@ func (t *T) GetSharedClient(clientID string) *Client {
373
372
374
373
t .Logf ("Using shared client %s with log position %d" , clientID , currentLogPosition )
375
374
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 {
395
376
t .Logf ("Warning: Failed to register shared client %s with test: %v" , clientID , err )
396
377
} else {
397
378
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 {
524
505
525
506
// Register test on simulation server and initialize the T.
526
507
t := & T {
527
- Sim : host ,
528
- SuiteID : test .suiteID ,
529
- suite : test .suite ,
508
+ Sim : host ,
509
+ SuiteID : test .suiteID ,
510
+ suite : test .suite ,
530
511
clientLogOffsets : make (map [string ]* LogOffset ), // Initialize log offset tracking
531
512
}
532
513
testID , err := host .StartTest (test .suiteID , test .request ())
0 commit comments