fix: Re-enable fee_estimate_query example and remove mirror-sync sleeps - #1732
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
b7d212d to
6485279
Compare
gsstoykov
left a comment
There was a problem hiding this comment.
Have you validated probing this a couple of times. Let's say 10-100?
Yes waitForFeeEstimationServiceReady uses sync.Once so the probe runs exactly once per test suite regardless of how many parallel tests call it. It actively polls a known-good intrinsic estimate every 5 seconds for up to 10 minutes, only unblocking tests once an actual success response comes back from the mirror node. This is fundamentally different from the old fixed time.Sleep(2s) the tests won't start until the service is genuinely ready, so repeated runs should not flake. |
|
Pls let me know in case if anything needs to be changed! |
- Remove fee_estimate_query skip block from Taskfile.yml run-examples task - Remove waitForMirrorNodeSync() calls from sdk/fee_estimate_query_e2e_test.go - Remove mirrorSyncDelay constant and waitForMirrorNodeSync() helper function - Rely on waitForFeeEstimationServiceReady() readiness probe instead of arbitrary sleeps Fixes hiero-ledger#1696 Signed-off-by: Mounil Kanakhara <mounilkankhara@gmail.com>
Signed-off-by: Mounil Kanakhara <mounilkankhara@gmail.com>
3a2d9cf to
4269de2
Compare
|
@Dosik13 @gsstoykov |
…ample On a fresh solo deployment the mirror node's FeeEstimationService races the importer ingesting the genesis fee schedule and returns HTTP 400 until the scheduled refresh fires. Add the same startup probe used in the integration tests so the example is robust on fresh local deployments. Signed-off-by: Mounil Kanakhara <mounilkankhara@gmail.com>
Dosik13
left a comment
There was a problem hiding this comment.
lgtm! thank you for the work and the patience!
Description:
Re-enable fee_estimate_query example in run-examples and remove mirror-sync sleeps
The
fee_estimate_queryexample was previously skipped in therun-examplestask due to intermittent failures on fresh local mirror node deployments. The underlying issue was that the mirror node hadn't ingested the operator's state when the example ran back-to-back with others.This PR removes the band-aid
time.Sleep()workarounds and re-enables the example by relying on the properwaitForFeeEstimationServiceReady()readiness probe, which polls the FeeEstimationService until it's actually ready to handle queries.Related issue(s):
Fixes #1696
Notes for reviewer:
The
waitForFeeEstimationServiceReady()function was already in place and working correctly. It probes the FeeEstimationService with a fresh INTRINSIC estimate request every 5 seconds until it succeeds or 10 minutes elapse. This is a proper solution compared to the previous blind 2-second sleep, as it:Checklist