MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / WaitForPayloads

Method WaitForPayloads

internal/testutil/server.go:218–233  ·  view source on GitHub ↗
(t *testing.T, count int, timeout time.Duration)

Source from the content-addressed store, hash-verified

216}
217
218func (w *WebhookReceiverResult) WaitForPayloads(t *testing.T, count int, timeout time.Duration) []ReceivedPayload {
219 t.Helper()
220 deadline := time.Now().Add(timeout)
221 for time.Now().Before(deadline) {
222 payloads := w.Payloads()
223 if len(payloads) >= count {
224 return payloads
225 }
226 time.Sleep(50 * time.Millisecond)
227 }
228 payloads := w.Payloads()
229 if len(payloads) < count {
230 t.Fatalf("expected %d webhook payloads, got %d after %v", count, len(payloads), timeout)
231 }
232 return payloads
233}
234
235// SubscriberCaptured is one POST the SubscriberReceiver caught. The
236// envelope is the parsed JSON body ({event, id, created_at, data})

Callers 1

TestOutboundAgentToAgentFunction · 0.80

Calls 1

PayloadsMethod · 0.95

Tested by 1

TestOutboundAgentToAgentFunction · 0.64