Skip to content

Conversation

@jglick
Copy link
Member

@jglick jglick commented Aug 17, 2023

Since the task recurs every 100ms, it seems unnecessary to read a file that we just wrote to disk.

Though `.watch` actually ran decent test coverage of push mode,
JaCoCo did not show `Watcher` since all the tests ran on agents in another JVM.
Adding a mode to run on-controller since people do sometimes do that,
and it should show up in JaCoCo,
and log messages from the watcher go to test output which is helpful.
@jglick jglick marked this pull request as draft August 18, 2023 18:07
@jglick

This comment was marked as resolved.

@jglick jglick marked this pull request as ready for review August 18, 2023 18:36
@jglick jglick requested review from car-roll and dwnusbaum August 18, 2023 19:11
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<dependencies>
<!-- https://github.com/jenkinsci/plugin-pom/pull/560#issuecomment-1656232490 -->
Copy link
Member Author

Choose a reason for hiding this comment

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

FilePath lastLocationFile = controller.getLastLocationFile(workspace);
if (lastLocationFile.exists()) {
lastLocation = Long.parseLong(lastLocationFile.readToString());
LOGGER.finest(() -> "Loaded lastLocation=" + lastLocation);
Copy link
Member Author

Choose a reason for hiding this comment

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

Seems to actually be missing from test coverage in this plugin currently; workflow-durable-task-step does exercise it in tests relating to agent disconnections and controller restarts.

@jglick jglick merged commit aa22cf1 into jenkinsci:master Aug 18, 2023
@jglick jglick deleted the lastLocation branch August 18, 2023 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants