Skip to content

keep target ids across SUT restarts with external drivers - #1956

Open
andyfelder16 wants to merge 4 commits into
masterfrom
fix-external-restart-ids
Open

andyfelder16 wants to merge 4 commits into
masterfrom
fix-external-restart-ids

Conversation

@andyfelder16

Copy link
Copy Markdown
Collaborator

When EvoMaster restarts a SUT run by an external driver, the new process starts with an empty id mapping in ObjectiveRecorder, while the core keeps asking for the ids of the old one. getDescriptiveId throws Id 'N' is not mapped, handleTargetInfos does not answer, the driver hits the socket timeout and restarts the SUT again, so the search ends up in a loop of restarts. In slow SUTs the first restart came from a separate issue: a request that timed out kept pushing to lastExecutedStatementStacks while AdditionalInfo was being serialized, and the ArrayDeque inside corrupted the stream.

  • ServerController records the numeric id of every target the SUT reports, and sends that mapping to the agent of a new SUT process as soon as it connects
  • AgentController loads it through ObjectiveRecorder.restoreIdMapping before the SUT classes run, so a restarted process answers for the same ids and gives new targets ids that do not clash with them. The agent waits for it at most 10 s
  • an id the process never mapped is answered as not reached, and handleTargetInfos always replies
  • the statement stacks in AdditionalInfo are ConcurrentLinkedDeque
  • tests for the restored mapping, for unknown ids, and for the mapping reaching a new SUT process through the socket

On two WFD SUTs run with external drivers (joinus 3x30 min, adoptme 2x1 h), the not mapped errors and the stream corruption are gone, and the search evaluates 4 to 18 times more tests.

@andyfelder16
andyfelder16 marked this pull request as ready for review November 27, 2026 12:32
@jgaleotti
jgaleotti requested a review from arcuri82 December 2, 2026 12:50
@andyfelder16
andyfelder16 requested a review from arcuri82 December 3, 2026 14:19
/**
* @return whether {@link #info(String)} prints, so that building an expensive message can be skipped
*/
public static boolean isInfoEnabled(){

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this? there is already isInfo() that does the same. maybe the name isLevel is misleading (as it is not an exact match). You could rename it into isLevelEnabled in this PR when you remove isInfoEnabled()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants