Skip to content

[Antithesis] Validate history collected by recording client #19868

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions tests/antithesis/test-template/robustness/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,25 @@ package main
import (
"context"
"fmt"
"math/rand"
"os"
"sync"
"testing"
"time"

"github.com/antithesishq/antithesis-sdk-go/assert"
"github.com/stretchr/testify/require"
"go.uber.org/zap"
"golang.org/x/time/rate"

"go.etcd.io/etcd/tests/v3/framework/e2e"
"go.etcd.io/etcd/tests/v3/robustness/client"
"go.etcd.io/etcd/tests/v3/robustness/identity"
robustnessrand "go.etcd.io/etcd/tests/v3/robustness/random"
"go.etcd.io/etcd/tests/v3/robustness/report"
"go.etcd.io/etcd/tests/v3/robustness/scenarios"
"go.etcd.io/etcd/tests/v3/robustness/traffic"
"go.etcd.io/etcd/tests/v3/robustness/validate"
)

var profile = traffic.Profile{
Expand Down Expand Up @@ -82,6 +89,14 @@ func testRobustness(ctx context.Context, baseTime time.Time, duration time.Durat
assert.Reachable("Completed robustness traffic generation", nil)
}

func validateReport(ctx context.Context, lg *zap.Logger, c *e2e.EtcdProcessCluster, s scenarios.TestScenario, t *testing.T) {
r := report.TestReport{Logger: lg, Cluster: c}
persistedRequests, err := report.PersistedRequestsCluster(lg, c)
require.NoError(t, err)
validateConfig := validate.Config{ExpectRevisionUnique: s.Traffic.ExpectUniqueRevision()}
r.Visualize = validate.ValidateAndReturnVisualize(t, lg, validateConfig, r.Client, persistedRequests, 5*time.Minute).Visualize
}

func connect(endpoint string, ids identity.Provider, baseTime time.Time) *client.RecordingClient {
cli, err := client.NewRecordingClient([]string{endpoint}, ids, baseTime)
if err != nil {
Expand Down