Server Watcher
Fileplugin.ymlFilepaper-plugin.ymlThe watcher reads the server log while tests run and picks out stack traces and plugin errors. It groups them, blames a plugin and the step or click that was running, and fails scenarios on them.
It catches Could not pass event, Task #... generated an exception, command exceptions, Error occurred while enabling, [Plugin] ... Exception, and any ERROR or SEVERE line with a trace under it. Warnings printed through [STDERR] count too.
curl "localhost:8767/watch/start"
curl "localhost:8767/watch/start?logFile=D:/server/logs/latest.log&ignore=No%20key%20layers"
curl "localhost:8767/watch/status?format=text"
curl "localhost:8767/watch/stop"Endpoints
| Endpoint | Parameters | Returns |
|---|---|---|
/watch/start | source=auto|managed|file, logFile, plugins (folder), ignore (regex, one per line), fromStart=1 | The watcher state |
/watch/status | since (ms), format=text | Source, lines read, errors and the groups |
/watch/stop | The final state |
How errors are read
| Part | How it works |
|---|---|
| Source | auto reads the managed server's console, and the next one after a restart. Without a managed server it tails logFile, or logs/latest.log in the configured server folder. A tailed file that gets rotated is read again from the top |
| Groups | Errors with the same root cause and the same top frames are one group, so Task #6 and Task #9 from the same bug count as 2 of one. A group has the count, first and last time, a sample trace, and up to 8 "during" labels |
| Plugin | The jars in the plugins folder are read for their plugin.yml or paper-plugin.yml. A frame is matched by its jar (IttDupeTest-1.0.0.jar//com... or ~[Shop-2.1.jar:?]) or by the main class package. The deepest cause's first plugin frame wins, then the plugin the header names. Every plugin seen is listed too |
| During | Scenario steps, bot actions, fuzz moves and crawl or load progress are written into a timeline. An error is blamed on what ran around it, like menu.yml step 4 click slot=11 > CiBot: click slot=11. Waits and expectations only get the blame when nothing else ran |
Failing scenarios on errors
While a watcher runs, /scenario/run fails a scenario that logged an error and adds serverErrors. A scenario can allow known ones:
name: shop
ignoreExceptions:
- "No key layers"
steps: [...]In CI and long jobs
| Where | What happens |
|---|---|
| CI mode | Watches the managed server by itself, or --server-log, or logs/latest.log in --server-dir. Each error group becomes a failing test case in the JUnit XML with the trace as its body, and a line in the summary. --ignore-exceptions <regex> (can repeat) allows errors for every scenario, --no-watch turns it off |
| Crawl and load | /crawl/status and /load/status list the server errors seen while the job ran, and load reports keep them |
| Fuzz | Fuzz runs start a watcher when none runs and stop it at the end |
The Watch page
The Watch page shows the same groups with their traces. It starts with one number, green when nothing was found, and has one key on an empty screen until it runs.
