Skip to content

Commit 74581fe

Browse files
committed
tests(system): surface self-healing execution traces in CI logs
1 parent 8e5cfca commit 74581fe

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

.github/workflows/tests.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,19 @@ jobs:
9595
- name: Run self-healing e2e tests
9696
run: make test-self-healing
9797

98+
- name: Dump self-healing runtime traces
99+
if: always()
100+
run: |
101+
cd tests/system
102+
for f in supernode0.out supernode1.out supernode2.out; do
103+
echo "==== ${f} (self-healing excerpts) ===="
104+
if [ -f "$f" ]; then
105+
grep -E "self-healing|sh-e2e-happy|RequestSelfHealing|VerifySelfHealing|CommitSelfHealing|reconstructed_hash_hex|observer" "$f" | tail -n 200 || true
106+
else
107+
echo "missing ${f}"
108+
fi
109+
done
110+
98111
# sn-manager-e2e-tests:
99112
# name: sn-manager-e2e-tests
100113
# runs-on: ubuntu-latest

tests/system/e2e_self_healing_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ func TestSelfHealingE2EHappyPath(t *testing.T) {
168168
registeredHashHex := hex.EncodeToString(registeredHashRaw)
169169
fileKey := pickAnchorKey(cmeta.RqIdsIds)
170170
require.NotEmpty(t, fileKey)
171+
t.Logf("self-healing fixture prepared action_id=%s file_key=%s registered_action_hash=%s", actionID, fileKey, registeredHashHex)
171172

172173
node0DiskKR, err := snkeyring.InitKeyring(snconfig.KeyringConfig{
173174
Backend: "test",
@@ -214,6 +215,7 @@ func TestSelfHealingE2EHappyPath(t *testing.T) {
214215
break
215216
}
216217
}
218+
t.Logf("self-healing role selection recipient=%s recipient_has_local=%t observer=%s observer_has_local=%t", recipient.Identity, recipient.HasLocal, observer.Identity, observer.HasLocal)
217219

218220
challengeID := fmt.Sprintf("sh-e2e-happy-%d", time.Now().UnixNano())
219221
req := &pb.RequestSelfHealingRequest{
@@ -227,11 +229,14 @@ func TestSelfHealingE2EHappyPath(t *testing.T) {
227229
}
228230
reqCtx, cancelReq := context.WithTimeout(ctx, 30*time.Second)
229231
defer cancelReq()
232+
t.Logf("self-healing request start challenge_id=%s recipient=%s observers=%v", challengeID, recipient.Identity, req.ObserverIds)
230233
reqRespSH, err := shClient.Request(reqCtx, recipient.Identity, recipient.GRPCAddr, req)
231234
require.NoError(t, err)
232235
require.True(t, reqRespSH.Accepted, "self-healing request was rejected: %s", reqRespSH.Error)
233236
require.NotEmpty(t, reqRespSH.ReconstructedHashHex)
237+
t.Logf("self-healing request response accepted=%t reconstruction_required=%t reconstructed_hash=%s", reqRespSH.Accepted, reqRespSH.ReconstructionRequired, reqRespSH.ReconstructedHashHex)
234238
require.True(t, strings.EqualFold(reqRespSH.ReconstructedHashHex, registeredHashHex), "recipient reconstructed hash mismatch: got=%s want=%s", reqRespSH.ReconstructedHashHex, registeredHashHex)
239+
t.Logf("self-healing hash assertion passed reconstructed_hash=%s registered_action_hash=%s", reqRespSH.ReconstructedHashHex, registeredHashHex)
235240
if recipientForcedReconstruct {
236241
require.True(t, reqRespSH.ReconstructionRequired, "expected reconstruction_required=true when recipient initially lacked local key")
237242
}
@@ -247,9 +252,11 @@ func TestSelfHealingE2EHappyPath(t *testing.T) {
247252
}
248253
verifyCtx, cancelVerify := context.WithTimeout(ctx, 30*time.Second)
249254
defer cancelVerify()
255+
t.Logf("self-healing verify start challenge_id=%s observer=%s recipient=%s", challengeID, observer.Identity, recipient.Identity)
250256
verifyResp, err := shClient.Verify(verifyCtx, observer.Identity, observer.GRPCAddr, verifyReq)
251257
require.NoError(t, err)
252258
require.True(t, verifyResp.Ok, "observer verification failed: %s", verifyResp.Error)
259+
t.Logf("self-healing verify response observer=%s ok=%t error=%q", verifyResp.ObserverId, verifyResp.Ok, verifyResp.Error)
253260

254261
commitReq := &pb.CommitSelfHealingRequest{
255262
ChallengeId: challengeID,
@@ -261,9 +268,11 @@ func TestSelfHealingE2EHappyPath(t *testing.T) {
261268
}
262269
commitCtx, cancelCommit := context.WithTimeout(ctx, 30*time.Second)
263270
defer cancelCommit()
271+
t.Logf("self-healing commit start challenge_id=%s recipient=%s", challengeID, recipient.Identity)
264272
commitResp, err := shClient.Commit(commitCtx, recipient.Identity, recipient.GRPCAddr, commitReq)
265273
require.NoError(t, err)
266274
require.True(t, commitResp.Stored, "self-healing commit failed: %s", commitResp.Error)
275+
t.Logf("self-healing commit response stored=%t error=%q", commitResp.Stored, commitResp.Error)
267276
}
268277

269278
func registerSelfHealingSupernodes(t *testing.T, cli *LumeradCli) {

0 commit comments

Comments
 (0)