test: CrowdSec console enrollment E2E cases are intermittently flaky

Open
#2,099 0 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@Wikid82 is already working on this.

Since Dec 1, 2026.

Assessment

This issue has not been assessed yet.

Description

crowdsec security testing

What

Several cases in tests/security/crowdsec-console-enrollment.spec.ts fail intermittently when the whole file runs under the security-tests project, then pass on an isolated re-run.

Where

tests/security/crowdsec-console-enrollment.spec.ts, cases:

  • "should send a forced request without asking for the acknowledgement" (toast not found)
  • "should require a token before retrying" (text not visible)
  • "should clear the state once confirmed..." (status label stays "Status: enrolled" for 5s)
  • "should show an error toast and keep the state when clearing fails" (toast not found)

Evidence

One full-file run had 4 failures. A copy of the spec from development had 1 failure on the same "clear the state" assertion. A second full-file run passed (35 passed, 2 skipped). The success handler of useClearConsoleEnrollment invalidates crowdsec-console-status, so the code path looks correct; the cause looks like timing between the stubbed status response and the refetch.

Severity

Low (test stability only).

Suggested approach

Wait on the status request that follows the clear action before asserting the label, and wait for the toast with an explicit response wait rather than a fixed timeout.

Found while working on the encrypted-secrets branch (not yet a PR).

Dominant language
Go
Stars
17
Forks
2
Avg merge
1h 42m
Merged PRs (30d)
173

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Wikid82/Charon

All issues in Wikid82/Charon

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.