util/eventbus: add test helpers to simplify testing events (#16294)

Instead of every module having to come up with a set of test methods for
the event bus, this handful of test helpers hides a lot of the needed
setup for the testing of the event bus.

The tests in portmapper is also ported over to the new helpers.

Updates #15160

Signed-off-by: Claus Lensbøl <claus@tailscale.com>
This commit is contained in:
Claus Lensbøl
2025-06-25 09:00:34 -04:00
committed by GitHub
parent 83cd446b5d
commit f2f1236ad4
7 changed files with 831 additions and 13 deletions
+10
View File
@@ -89,4 +89,14 @@
// The [Debugger], obtained through [Bus.Debugger], provides
// introspection facilities to monitor events flowing through the bus,
// and inspect publisher and subscriber state.
//
// Additionally, a debug command exists for monitoring the eventbus:
//
// tailscale debug daemon-bus-events
//
// # Testing facilities
//
// Helpers for testing code with the eventbus can be found in:
//
// eventbus/eventbustest
package eventbus