test: fix unknownBlockSync e2e assertions for gloas#9276
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the unknownBlockSync E2E tests by removing the maybeWaitForPayloadImported logic and instead retrieving PayloadEnvelopeInput directly from the cache during the incompletePayloadEnvelope test case. Feedback indicates that removing the wait for the payload sync to complete may introduce flakiness, as the test could finish and shut down the node before the background sync process actually finishes.
| const payloadInput = bn2.chain.seenPayloadEnvelopeInputCache.get(headRootHex); | ||
| if (!payloadInput) { | ||
| throw Error(`Expected PayloadEnvelopeInput for ${headRootHex} after block sync`); | ||
| } |
There was a problem hiding this comment.
The incompletePayloadEnvelope test case triggers a payload sync by emitting an event but does not wait for the sync to complete. Since the sync happens in the background, the test might finish and close the node (via afterEach) before the payload is actually imported. This could lead to flakiness or a false positive where the sync logic is triggered but not actually completed. Consider waiting for the routes.events.EventType.executionPayload event after emitting the trigger to ensure the sync is fully exercised.
Performance Report✔️ no performance regression detected Full benchmark results
|
| } | ||
|
|
||
| // only await payload import for events that imply importing it | ||
| await maybeWaitForPayloadImported; |
There was a problem hiding this comment.
hmm might be that the test is just not waiting now? tests are passing but mayeb we a not asserting stuff anymore
There was a problem hiding this comment.
| Case | Drives head-payload import? | Currently asserted? |
|---|---|---|
| blockUnknownParent | no — only parent payloads | head event only — correct |
| unknownBlockRoot | no — only parent payloads | head event only — correct |
| incompleteBlockInput | no — only parent payloads | head event only — correct |
| unknownEnvelopeBlockRoot | yes | head event only — gap |
| envelopeUnknownBlock (new) | yes | head + payload — fixed |
| incompletePayloadEnvelope | yes | head + payload — fixed |
we are only missing unknownEnvelopeBlockRoot, gonna add that
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## unstable #9276 +/- ##
=========================================
Coverage 52.58% 52.58%
=========================================
Files 848 848
Lines 61136 61136
Branches 4505 4505
=========================================
Hits 32147 32147
Misses 28925 28925
Partials 64 64 🚀 New features to boost your workflow:
|
We merged #9241 without actually checking if e2e test passed.