cleanup: flakey tests and race conditions

This commit is contained in:
Jay
2026-06-04 12:07:03 -04:00
parent b5b0ec77ba
commit dda3bfd5b7
4 changed files with 15 additions and 8 deletions
+2 -2
View File
@@ -139,8 +139,6 @@ func (p *EventPublisher) Close() {
p.wg.Wait()
}
// trySend sends the EVENT envelope. It does not modify entry.sent — callers
// are responsible for setting it under p.mu before and/or after this call.
func (p *EventPublisher) trySend(entry *pendingEntry) error {
entry.mu.Lock()
defer entry.mu.Unlock()
@@ -212,9 +210,11 @@ func (p *EventPublisher) handleEvents() {
p.mu.Lock()
var toSend []*pendingEntry
for _, e := range p.pending {
e.mu.Lock()
if !e.sent {
toSend = append(toSend, e)
}
e.mu.Unlock()
}
p.mu.Unlock()