jojo/services/actions
Mathieu Fenniak 66f08baa1a fix: prevent intermittent test failures caused by uncancellable tasks (#10713)
Attempt to fix intermittent test failure noted in #10633, detailed technical notes in https://codeberg.org/forgejo/forgejo/issues/10633#issuecomment-9571199.

- Failure to cancel the previous processes is now a test error that aborts immediately, preventing 2hr long test runs that won't succeed.
- When the process cancellation fails, the stack trace of all goroutines is printed to help diagnose the cause of any failure to cancel tasks.
- `context.Background()` referenced in the actions notifier is corrected when opening git repos, which seems to be a cause of failure to cancel the tasks -- git subprocesses are spawned from the repo context, which is the background context, and that prevents the context registered in the process manager from cancelling them.

## Checklist

The [contributor guide](https://forgejo.org/docs/next/contributor/) contains information that will be helpful to first time contributors. There also are a few [conditions for merging Pull Requests in Forgejo repositories](https://codeberg.org/forgejo/governance/src/branch/main/PullRequestsAgreement.md). You are also welcome to join the [Forgejo development chatroom](https://matrix.to/#/#forgejo-development:matrix.org).

### Tests

- I added test coverage for Go changes...
  - [ ] in their respective `*_test.go` for unit tests.
  - [ ] in the `tests/integration` directory if it involves interactions with a live Forgejo server.
- I added test coverage for JavaScript changes...
  - [ ] in `web_src/js/*.test.js` if it can be unit tested.
  - [ ] in `tests/e2e/*.test.e2e.js` if it requires interactions with a live Forgejo server (see also the [developer guide for JavaScript testing](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/tests/e2e/README.md#end-to-end-tests)).

### Documentation

- [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change.
- [x] I did not document these changes and I do not expect someone else to do it.

### Release notes

- [x] I do not want this change to show in the release notes.
- [ ] I want the title to show in the release notes with a link to this pull request.
- [ ] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/10713
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Mathieu Fenniak <mathieu@fenniak.net>
Co-committed-by: Mathieu Fenniak <mathieu@fenniak.net>
2026-01-06 15:34:43 +01:00
..
Test_tryHandleIncompleteMatrix feat: support reusable workflow expansion when with or strategy.matrix contains ${{ needs... }} (#10647) 2025-12-31 19:04:35 +01:00
Test_tryHandleWorkflowCallOuterJob fix: re-running an expanded reusable workflow causes duplicate "attempt 1" job (#10666) 2026-01-02 15:26:11 +01:00
TestActions_CancelOrApproveRun refactor: migrate from lib/pq to jackc/pgx (#10219) 2025-11-30 17:47:45 +01:00
TestActions_consistencyCheckRun feat(actions): support referencing ${{ needs... }} variables in runs-on (#10308) 2025-12-05 18:14:43 +01:00
TestActionsNotifier_IsTrusted chore(refactor): replace ifNeedApproval with trust management 2025-11-06 11:07:39 +01:00
TestActionsTrust_GetPullRequestUserIsTrustedWithActions feat: trust management for runs created from a forked pull request 2025-11-06 11:07:38 +01:00
TestCancelPreviousJobs refactor: migrate from lib/pq to jackc/pgx (#10219) 2025-11-30 17:47:45 +01:00
TestCancelPreviousWithConcurrencyGroup refactor: migrate from lib/pq to jackc/pgx (#10219) 2025-11-30 17:47:45 +01:00
TestCreateCommitStatus fix: don't duplicate commit status records on workflows with empty name (#10678) 2026-01-02 19:02:10 +01:00
TestExpandLocalReusableWorkflows feat: expand reusable workflow calls into their inner jobs (#10525) 2025-12-24 20:47:21 +01:00
TestGetSecretsOfJob feat: support jobs.<job_id>.secrets with reusable workflow expansion (#10627) 2025-12-30 17:33:21 +01:00
TestServiceActions_startTask fix: a corrupted Forgejo Actions scheduled workflow is disabled (#8942) 2025-08-18 22:45:10 +02:00
TestServicesActions_TransferLingeringLogs refactor: migrate from lib/pq to jackc/pgx (#10219) 2025-11-30 17:47:45 +01:00
auth.go chore(cleanup): replaces unnecessary calls to formatting functions by non-formatting equivalents (#7994) 2025-05-29 17:34:29 +02:00
auth_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
cleanup.go feat: auto cleanup of offline runners (#7803) 2025-06-08 00:13:37 +02:00
cleanup_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
clear_tasks.go Actions Done Notification (#7491) 2025-04-24 15:15:24 +00:00
commit_status.go fix: retain Forgejo Action's commit_status entries with distinct descriptions (#10696) 2026-01-05 14:47:27 +01:00
commit_status_test.go fix: retain Forgejo Action's commit_status entries with distinct descriptions (#10696) 2026-01-05 14:47:27 +01:00
context.go feat: add Forgejo server version to runner context (#10642) 2025-12-30 22:39:34 +01:00
context_test.go feat: support workflow inputs on expanded reusable workflows (#10614) 2025-12-29 15:37:44 +01:00
init.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
interface.go feat: add HTTP API endpoint for runner registration (#10677) 2026-01-05 04:59:04 +01:00
job_emitter.go fix: simultaneously experiencing a PreExecutionError and unblocking a different job causes error blocking job emitter queue (#10665) 2026-01-02 17:11:12 +01:00
job_emitter_test.go fix: simultaneously experiencing a PreExecutionError and unblocking a different job causes error blocking job emitter queue (#10665) 2026-01-02 17:11:12 +01:00
log.go fix: garbage collect lingering actions logs (#10009) 2025-11-18 18:59:01 +01:00
log_test.go chore(lint): Add exceptions for dbfs_model and unittest (#10275) 2025-12-09 14:34:06 +01:00
main_test.go chore: move all test blank imports in a single package (#10662) 2026-01-02 05:32:32 +01:00
notifier.go feat: github compatability for removing label from issue API (#8831) 2025-08-30 03:29:23 +02:00
notifier_helper.go fix: prevent intermittent test failures caused by uncancellable tasks (#10713) 2026-01-06 15:34:43 +01:00
notifier_helper_test.go feat: expand reusable workflow calls into their inner jobs (#10525) 2025-12-24 20:47:21 +01:00
rerun.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
rerun_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
reusable_workflows.go feat: expand reusable workflow calls into their inner jobs (#10525) 2025-12-24 20:47:21 +01:00
reusable_workflows_test.go feat: expand reusable workflow calls into their inner jobs (#10525) 2025-12-24 20:47:21 +01:00
run.go feat: support reusable workflow expansion when with or strategy.matrix contains ${{ needs... }} (#10647) 2025-12-31 19:04:35 +01:00
run_test.go feat(actions): support referencing ${{ needs... }} variables in runs-on (#10308) 2025-12-05 18:14:43 +01:00
schedule_tasks.go feat: expand reusable workflow calls into their inner jobs (#10525) 2025-12-24 20:47:21 +01:00
schedule_tasks_test.go feat: expand reusable workflow calls into their inner jobs (#10525) 2025-12-24 20:47:21 +01:00
secret.go feat: support jobs.<job_id>.secrets with reusable workflow expansion (#10627) 2025-12-30 17:33:21 +01:00
secret_test.go feat: support jobs.<job_id>.secrets with reusable workflow expansion (#10627) 2025-12-30 17:33:21 +01:00
task.go feat: support jobs.<job_id>.secrets with reusable workflow expansion (#10627) 2025-12-30 17:33:21 +01:00
trust.go feat: trust management for runs created from a forked pull request 2025-11-06 11:07:38 +01:00
trust_test.go feat: trust management for runs created from a forked pull request 2025-11-06 11:07:38 +01:00
variables.go chore(lint): Add exceptions for dbfs_model and unittest (#10275) 2025-12-09 14:34:06 +01:00
variables_test.go fix: allow Forgejo Actions environment variables starting with CI (#8850) 2025-08-10 22:56:16 +02:00
workflows.go feat: expand reusable workflow calls into their inner jobs (#10525) 2025-12-24 20:47:21 +01:00
workflows_test.go Update module code.forgejo.org/forgejo/runner/v11 to v12 (forgejo) (#10213) 2025-11-23 15:58:57 +01:00