Fix CI failures: upgrade actions/upload-artifact v3 to v4, add test job timeout, fix CacheStats self-deadlock, and resolve all pre-existing test, formatting, linting, and integration test failures#88
Conversation
Agent-Logs-Url: https://github.com/sjackson0109/PowerTraderAI/sessions/fcb56c3e-a2c4-455a-855f-525ac8b61b03 Co-authored-by: sjackson0109 <38080190+sjackson0109@users.noreply.github.com>
|
@copilot Evaluate why this pipeline seemed to run continuously... https://github.com/sjackson0109/PowerTraderAI/actions/runs/26019138087/job/76476113674?pr=88 |
Agent-Logs-Url: https://github.com/sjackson0109/PowerTraderAI/sessions/fec0c222-1004-4f72-b411-fb8eb8b899f0 Co-authored-by: sjackson0109 <38080190+sjackson0109@users.noreply.github.com>
The pipeline ran continuously because the What the logs show:
Why
Fix applied (commit The underlying test-code issues (daemon threads, subprocess deadlock, GUI instantiation on headless runners) are separate concerns that would need to be addressed in the test files themselves. |
|
@copilot what caused the hang though? Which test, and can we prove that test works here? |
…Lock Agent-Logs-Url: https://github.com/sjackson0109/PowerTraderAI/sessions/b0e4ba9f-93dc-4ba4-878c-7894a510d874 Co-authored-by: sjackson0109 <38080190+sjackson0109@users.noreply.github.com>
The exact test was Root cause — a self-deadlock in
# pt_caching_system.py — CacheStats
def get_stats_dict(self):
with self._lock: # thread acquires Lock
...
'hit_ratio': self.get_hit_ratio() # calls...
def get_hit_ratio(self):
with self._lock: # same thread tries to re-acquire → DEADLOCK
...Proven locally:
Fix (commit - self._lock = threading.Lock()
+ self._lock = threading.RLock()
Verified: both |
|
@copilot Several failures in the CI jobs |
These failures are all pre-existing and unrelated to the changes in this PR. Our commits only touched The good news first: the job completed in 30 seconds (09:04:04 → 09:04:36) instead of hanging for 60+ minutes. Both fixes are working correctly. Why these failures are now visible: previously the entire run stalled at The two failure categories: 1. Unit Tests — 12 failures + 5 errors (pre-existing):
2. Code Quality — Black formatting (pre-existing): These are genuine bugs/drift in the application code and test suite that pre-date this PR and need to be addressed separately. Happy to tackle them in a follow-up PR if useful. |
…Black formatting Agent-Logs-Url: https://github.com/sjackson0109/PowerTraderAI/sessions/3dafeedd-2f0f-4962-857a-f9a00fd3eb0c Co-authored-by: sjackson0109 <38080190+sjackson0109@users.noreply.github.com>
Investigated all workflows on this PR. Here's the full status and what was fixed in commit PowerTrader AI+ CI/CD (run 26022839641) had 2 failing jobs: Unit Tests — 12 failures + 5 errors (now fixed):
Code Quality — Black formatting (now fixed): Ran Other workflows: The |
…nd headless display skips Agent-Logs-Url: https://github.com/sjackson0109/PowerTraderAI/sessions/abca24d0-31a8-49ce-9bc1-1fe059b14c2a Co-authored-by: sjackson0109 <38080190+sjackson0109@users.noreply.github.com>
Checked all pipelines on this PR. The latest run (26025635362 on commit Code Quality — Flake8 (now fixed):
Unit Tests — 6 failures (now fixed):
Security Scan — ✅ passing throughout. |
…adless runners, fix DataProvider method call Agent-Logs-Url: https://github.com/sjackson0109/PowerTraderAI/sessions/f48244ad-fce5-4b06-ba67-15dc2a05eb9e Co-authored-by: sjackson0109 <38080190+sjackson0109@users.noreply.github.com>
…prehensive.py Agent-Logs-Url: https://github.com/sjackson0109/PowerTraderAI/sessions/f48244ad-fce5-4b06-ba67-15dc2a05eb9e Co-authored-by: sjackson0109 <38080190+sjackson0109@users.noreply.github.com>
Checked all pipelines on the latest run (commit 10 of 11 jobs passed. The one failure was the
All other workflows were already passing:
|
... All pipelines on the latest commit ( PowerTrader AI+ CI/CD (run 26043533254) — ✅ all jobs passed:
Code Quality & Testing (run 26043533311) — ✅ all jobs passed:
|
... All pipelines on commit PowerTrader AI+ CI/CD (run 26043533254) — ✅ all jobs passed:
Code Quality & Testing (run 26043533311) — ✅ all jobs passed:
The Integration Tests job ran
... All pipelines on the latest commit ( PowerTrader AI+ CI/CD (run 26043533254) — ✅ all jobs passed:
Code Quality & Testing (run 26043533311) — ✅ all jobs passed:
|
sjackson0109
left a comment
There was a problem hiding this comment.
Most of these 3k+ changes are simply extra spaces, or incorrect tab-indexes/spaces. Materially not too much has changed.
the upload-artifacts v3>v4 change raises several smaller CI pipeline failures that in-turn resulted in 3x more changes, all imaterial.
|
@copilot Can you support me with these? We might have to fix these in a new branch, and raise another PR to bring them in. https://github.com/sjackson0109/PowerTraderAI/actions/runs/26047502157/job/76575428334 |
Original prompt
Fix the failing GitHub Actions workflow in repository
sjackson0109/PowerTraderAI.Context:
actions/upload-artifact: v3..github/workflows/ci-cd.yml.uses: actions/upload-artifact@v3references that must be updated to@v4.Required changes:
main..github/workflows/ci-cd.ymlso that both artifact upload steps useactions/upload-artifact@v4instead of@v3.mainwith a concise title and description explaining that the workflow failed because GitHub deprecatedupload-artifact@v3and that the fix upgrades the workflow tov4.The following is the prior conversation context from the user's chat exploration (may be truncated):
User: Please find a solution for this failing job. Use the logs, job definition, and any referenced files where the failure occurred. Keep your response focused on the solution and include code suggestions when appropriate.
Assistant: The failure is caused by a deprecated GitHub Action, not by your Python code.
Root cause
The job log shows:
This request has been automatically failed because it uses a deprecated version of actions/upload-artifact: v3The failing references are in the workflow file:
.github/workflows/ci-cd.ymlat commit2cbb859163120838c967de01c246a6e08728029esecurity-scanjob:.github/workflows/ci-cd.yml#L33-L39code-qualityjob:.github/workflows/ci-cd.yml#L67-L71Fix
Update both artifact upload steps from
@v3to@v4.Suggested patch
Minimal diff
Apply that change in both places:
Why this solves it
GitHub is now automatically failing workflows that still use
actions/upload-artifact@v3, so the job never gets past action setup. Replacing it with@v4removes the platform-level failure.Relevant file
If you want the exact edited workflow block, use: