oficina / equipo Public

Clone
git clone https://amadan.net/oficina/equipo

Plain git — no account needed to clone.

Download

Download this file

1package runner
2
3import (
4 "context"
5 "errors"
6 "testing"
7 "time"
8
9 "amadan.net/oficina/equipo/internal/runner/provider"
10)
11
12func TestUncertainSendIsNotRetried(t *testing.T) {
13 ctx, cancel := context.WithTimeout(context.Background(), time.Second)
14 defer cancel()
15 sends, lost := 0, 0
16 err := sendAdmittedTurn(ctx, func() error { sends++; return provider.ErrUncertain }, func(context.Context) error { lost++; return nil })
17 if !errors.Is(err, provider.ErrUncertain) || sends != 1 || lost != 1 {
18 t.Fatalf("uncertain turn retried or not recorded: sends=%d lost=%d err=%v", sends, lost, err)
19 }
20}
21