detached 5a1c47b

test(broker): request local observation explicitly in fixtures

commit
5a1c47bb37dc96e37dd279cf58cf3cceac1802dc
author
brice · · 2026-09-23 09:43 UTC
parent
4827e8f
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
1 file · +3 -1
M internal/app/broker_offline_local_test.go +3 -1
@@ -791,6 +791,7 @@ func TestBrokerLocalObservationRegistryPublishesLocalFirst(t *testing.T) {
791791 done := make(chan struct{})
792792 go func() { defer close(done); registry.Run(ctx) }()
793793 t.Cleanup(func() { cancel(); <-done })
794+ registry.RequestProbe("")
794795
795796 require.Eventually(t, func() bool {
796797 snapshot := registry.Snapshot()
@@ -932,10 +933,11 @@ func TestBrokerLocalProbeNilReceiverFailsClosed(t *testing.T) {
932933 // startLocalRegistry runs one registry for the duration of a test.
933934 func startLocalRegistry(t *testing.T, registry *broker.Registry) {
934935 t.Helper()
936+ registry.SetDemand(true)
935937 ctx, cancel := context.WithCancel(context.Background())
936938 done := make(chan struct{})
937939 go func() { defer close(done); registry.Run(ctx) }()
938- t.Cleanup(func() { cancel(); <-done })
940+ t.Cleanup(func() { cancel(); <-done; registry.SetDemand(false) })
939941 }
940942
941943 // waitLocalEntry waits for the published local entry (always index zero) to
@@ -791,6 +791,7 @@ func TestBrokerLocalObservationRegistryPublishesLocalFirst(t *testing.T) {
791 done := make(chan struct{})791 done := make(chan struct{})
792 go func() { defer close(done); registry.Run(ctx) }()792 go func() { defer close(done); registry.Run(ctx) }()
793 t.Cleanup(func() { cancel(); <-done })793 t.Cleanup(func() { cancel(); <-done })
794+ registry.RequestProbe("")
794 795
795 require.Eventually(t, func() bool {796 require.Eventually(t, func() bool {
796 snapshot := registry.Snapshot()797 snapshot := registry.Snapshot()
@@ -932,10 +933,11 @@ func TestBrokerLocalProbeNilReceiverFailsClosed(t *testing.T) {
932 // startLocalRegistry runs one registry for the duration of a test.933 // startLocalRegistry runs one registry for the duration of a test.
933 func startLocalRegistry(t *testing.T, registry *broker.Registry) {934 func startLocalRegistry(t *testing.T, registry *broker.Registry) {
934 t.Helper()935 t.Helper()
936+ registry.SetDemand(true)
935 ctx, cancel := context.WithCancel(context.Background())937 ctx, cancel := context.WithCancel(context.Background())
936 done := make(chan struct{})938 done := make(chan struct{})
937 go func() { defer close(done); registry.Run(ctx) }()939 go func() { defer close(done); registry.Run(ctx) }()
938- t.Cleanup(func() { cancel(); <-done })940+ t.Cleanup(func() { cancel(); <-done; registry.SetDemand(false) })
939 }941 }
940 942
941 // waitLocalEntry waits for the published local entry (always index zero) to943 // waitLocalEntry waits for the published local entry (always index zero) to

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 12

Tags 11

↑↓ moveenter openesc close