fetch_ml/tests/e2e
Jeremie Fraeys ba9a358412
fix(scheduler): resolve TestEndToEndJobLifecycle race and getTask bug
## Problem
TestEndToEndJobLifecycle was failing with two issues:
1. Race condition: Workers signaled ready before job was processed, receiving
   MsgNoWork instead of MsgJobAssign
2. getTask() didn't check pendingAcceptance - assigned-but-not-yet-accepted
   tasks returned nil

## Changes

### Test Fix (restart_recovery_test.go)
- Replace single-shot select with retry loop that re-signals workers as ready
- Handle both assignment and non-assignment messages correctly
- Add 10ms delay between non-assignment messages to allow job processing
- Use 2-second deadline with 100ms timeout intervals

### Scheduler Fix (hub.go)
- Extend getTask() to check pendingAcceptance map after batch/service queues
- Allows GetTask() to find tasks in 'assigned' state before acceptance
- Maintains backward compatibility with existing queue/running lookups

## Testing
make test now passes: 475 passed, 0 failed, 34 skipped
2026-03-05 14:40:43 -05:00
..
scheduler fix(scheduler): resolve TestEndToEndJobLifecycle race and getTask bug 2026-03-05 14:40:43 -05:00
cli_api_e2e_test.go test: modernize test suite for streamlined infrastructure 2026-03-04 13:24:24 -05:00
example_test.go test: modernize test suite for streamlined infrastructure 2026-03-04 13:24:24 -05:00
homelab_e2e_test.go test(e2e): skip gracefully when Redis unavailable, fix cross-device link 2026-02-21 21:20:47 -05:00
job_lifecycle_e2e_test.go test: expand unit/integration/e2e coverage for new worker/api behavior 2026-01-05 12:31:36 -05:00
logs_debug_e2e_test.go chore: migrate scripts from docker-compose v1 to v2 2026-03-04 13:22:26 -05:00
main_test.go test: expand unit/integration/e2e coverage for new worker/api behavior 2026-01-05 12:31:36 -05:00
ml_project_variants_test.go test: modernize test suite for streamlined infrastructure 2026-03-04 13:24:24 -05:00
phase2_features_test.go feat: Research features - narrative fields and outcome tracking 2026-02-18 21:27:05 -05:00
podman_integration_test.go test(all): update test suite for scheduler and security features 2026-02-26 12:08:46 -05:00
sync_test.go Fix multi-user authentication and clean up debug code 2025-12-06 12:35:32 -05:00
tracking_test.go test: expand unit/integration/e2e coverage for new worker/api behavior 2026-01-05 12:31:36 -05:00
tui_ssh_test.go feat: add TUI SSH usability testing infrastructure 2026-02-18 17:48:02 -05:00
websocket_e2e_test.go test: Reorganize and add unit tests 2026-02-18 21:28:13 -05:00
wss_reverse_proxy_e2e_test.go test: Reorganize and add unit tests 2026-02-18 21:28:13 -05:00