From e6c29dc5e90c30657b96563a203d3ed0615a0128 Mon Sep 17 00:00:00 2001 From: Tiexin Guo Date: Thu, 19 Sep 2024 17:24:38 +0800 Subject: [PATCH] chore: refactor after review --- tests/run_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/run_test.go b/tests/run_test.go index e0b9dbb7..9d29a6b3 100644 --- a/tests/run_test.go +++ b/tests/run_test.go @@ -172,7 +172,11 @@ identities: } _, stderrCh := pebbleRun(t, pebbleDir, "--identities="+filepath.Join(pebbleDir, identitiesFileName)) - waitForLog(t, stderrCh, "pebble", "Started daemon", 3*time.Second) + + // wait for log "Started daemon" like in other test cases then immediately run `pebble identity` would sometimes + // fail because the identities are not fully seeded. Waiting for the next log "POST /v1/services" can guarantee + // identities are seeded when running the `pebble identity` command without sleeping for a short period of time. + waitForLog(t, stderrCh, "pebble", "POST /v1/services", 3*time.Second) output := runPebbleCommand(t, pebbleDir, "identity", "bob") expected := `