[KS-313] Changing write_target to wait until finalization
This change causes the workflow to stay alive in the write capability until the write_target gets confirmation from the ChainWriter that the write has been finalized. It will also end the wait if the transaction is fatal, we fail to get a valid transaction status, or if we hit the timeout on the context object.
I tested this with unit tests, verifying that the timeout did break the wait and that it returned successfully on finalization.
Just wanted to call out that I have already implemented a function very similar to this in chainlink-common. It is test-specific but it wouldn't be very difficult to extract the test specific logic and have it accessible to any product / capability that uses ChainWriter. That way we could avoid rewriting code and have a standardized and consistent way to poll for finality.
Below is an analysis created by an LLM. Be mindful of hallucinations and verify accuracy.
WF: CI Core#5b6e431
Error 1: Test Failures in Core Tests
Source of Error:
Core Tests (go_core_tests) Run tests 2024-10-04T23:02:38.5681299Z Encountered test failures.
Core Tests (go_core_tests) Run tests 2024-10-04T23:02:38.5685910Z go_core_tests exiting with code 1
Core Tests (go_core_tests) Run tests 2024-10-04T23:02:38.5698835Z ##[error]Process completed with exit code 1.
Why: The error logs indicate that the test suite encountered failures during execution, which caused the process to exit with code 1. This typically happens when one or more tests assert conditions that do not meet the expected outcomes, leading to a non-zero exit status.
Suggested fix: Review the test cases and the assertions within them to identify why they are failing. Ensure that the test environment is correctly set up and that all dependencies are correctly mocked or stubbed as needed. Fix the failing assertions either by correcting the test logic or the application code being tested.
Error 2: Race Condition Detected in Core Race Tests
Source of Error:
Core Tests (go_core_race_tests) Run tests 2024-10-04T23:00:36.7572526Z Race(s) detected
Core Tests (go_core_race_tests) Run tests 2024-10-04T23:00:36.7589564Z ##[error]Process completed with exit code 1.
Why: The error indicates that a race condition was detected during the execution of the race tests. This typically occurs when multiple threads access shared data concurrently without proper synchronization, leading to unpredictable behavior and potential bugs.
Suggested fix: Investigate the race condition by examining the output from the race detector and identifying the involved variables or data structures. Implement proper synchronization mechanisms such as mutexes, channels, or atomic operations to ensure that concurrent access is safely handled. Re-run the race tests to confirm that the issue has been resolved.
Quality Gate passed
Issues
0 New issues
0 Fixed issues
0 Accepted issues
Measures
0 Security Hotspots
80.0% Coverage on New Code
0.0% Duplication on New Code
This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.