merged from gramsrv upstream

This commit is contained in:
onysd 2026-09-01 12:06:31 +03:00
parent 79c64ee916
commit 21a0856587
651 changed files with 54774 additions and 4590 deletions

View file

@ -272,7 +272,8 @@ func TestServeMixedStopsAllComponentsWhenOneReturnsCleanly(t *testing.T) {
type countingAuthKeyStore struct {
store.AuthKeyStore
gets atomic.Int32
gets atomic.Int32
revalidates atomic.Int32
}
func (s *countingAuthKeyStore) Get(ctx context.Context, id [8]byte) (store.AuthKeyData, bool, error) {
@ -280,6 +281,11 @@ func (s *countingAuthKeyStore) Get(ctx context.Context, id [8]byte) (store.AuthK
return s.AuthKeyStore.Get(ctx, id)
}
func (s *countingAuthKeyStore) Revalidate(ctx context.Context, id [8]byte) (store.AuthKeyData, bool, error) {
s.revalidates.Add(1)
return s.AuthKeyStore.Revalidate(ctx, id)
}
func TestUnknownAuthKeyRespondsOnceThenCloses(t *testing.T) {
keys := &countingAuthKeyStore{AuthKeyStore: memory.NewAuthKeyStore()}
addr, _, _ := startTestServer(t, Options{AuthKeys: keys})