Server Watcher

3files
1figure
2min read
Sheet 29 of 47 · Server

Filesplugin.yml · paper-plugin.yml · shop.yml

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

EndpointParametersReturns
/watch/startsource=auto|managed|file, logFile, plugins (folder), ignore (regex, one per line), fromStart=1The watcher state
/watch/statussince (ms), format=textSource, lines read, errors and the groups
/watch/stopThe final state

How errors are read

PartHow it works
Sourceauto 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
GroupsErrors 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
PluginThe 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
DuringScenario 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:

shop.yml
name: shop
ignoreExceptions:
  - "No key layers"
steps: [...]

In CI and long jobs

WhereWhat happens
CI modeWatches 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
FuzzFuzz 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.

Watch: server errors grouped, with plugin, trace and what was running.
The Watch page with server errors grouped, each with its plugin, trace and what was running

Loading the index

Enter openUp Down moveEsc close