-
Notifications
You must be signed in to change notification settings - Fork 500
WIP: Enable shared clients on testsuite level #1285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
0802366
to
f5a315d
Compare
This commit implements shared client functionality to improve resource efficiency by allowing clients to be reused across multiple tests in a test suite. Key features include: - New API endpoints for shared client management - Data structures for tracking shared client state - Log segment extraction for proper test result attribution - Integration with hiveview for log display - Documentation updates for all new methods and types
Added comprehensive unit tests for shared client functionality, including: - TestStartSharedClient - Tests the StartSharedClient method - TestAddSharedClient - Tests shared client registration in suites - TestSharedClientLogOffset - Tests log offset tracking - TestSharedClientLogExtraction - Tests log extraction - TestGetClientLogOffset - Tests the GetClientLogOffset function Also added ExecSharedClient method to Simulation type to support executing commands in shared clients
…stances When multiple clients of the same type exist in a suite, auto-registration now selects the most recently created client instead of skipping registration entirely. This ensures that tests properly register with a shared client even when multiple instances of the same client type are running.
Add line number tracking to shared client log segments to enable proper highlighting in the UI. Adds a line counting algorithm to convert byte positions to line numbers and enhances related data structures.
Updates the UI to properly display log links for shared clients with line range highlighting. Enhances client detection logic to work with multiple client instances of the same type, and improves the log viewer to properly highlight line ranges.
} | ||
|
||
// ClientLogSegment represents a segment of a client log file | ||
type ClientLogSegment struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to make sense of all the logging situation but I could not quite figure it out.
IMO I think it's not really functional at this point and we should just remove it from this PR and add it in a follow-up PR.
hivesim/data.go
Outdated
type LogOffset struct { | ||
Start int64 `json:"start"` // Byte offset where this section begins | ||
End int64 `json:"end"` // Byte offset where this section ends | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This slipped, it's no longer necessary I think.
This PR adds support for "shared clients", a new type of client that allows the client's instance (container) to be reused across multiple tests within a test suite. The aim is to preserve client state between tests in order to allow multiple EL tests to be executed against a single running client container to avoid client start-up time and speed-up testing.
Backend
hivesim/hive.go
with methods:StartSharedClient
andGetSharedClientInfo
.hivesim/testapi.go
withAddSharedClient
andGetSharedClient
.hivesim/data.go
for tracking shared client state.Frontend
Testing
shared_client_test.go
that cover all major functionality:TestStartSharedClient
: Tests client creation at the suite levelTestAddSharedClient
: Tests client registration and retrieval in testsTestSharedClientLogOffset
: Tests log position trackingTestSharedClientLogExtraction
: Tests log segmentationTestGetClientLogOffset
: Tests the log offset API