Repository navigation
Description
What this asks for
Give merge-queue E2E runs their own part of the DEV test pool, so pull-request runs cannot use up the API quota the queue needs, and the reverse.
cc @ifireball @ggallen @rh-hemartin for a decision on the split and its size.
Why
Pull-request runs and merge-queue runs of E2E Tests both use the dev environment and the same 22 orgs (halfsend-01 to halfsend-22). Each org has its own quota of 5,000 API requests an hour, and every suite claims repos from whichever org has free slots. The two kinds of run therefore spend the same quota.
On 2026-11-11 and 12 this stopped the queue:
- Five merge groups (
max_entries_to_build: 5) plus pull-request runs were in progress at once. - All 22 orgs returned
403 rate limit: primary quota exhausted. Suites ran no scenarios and were killed at the 45-minute job limit. - Nothing merged from 23:34 to 05:01 UTC. It recovered only after re-runs and re-queues were held back by hand so that about three suites ran at a time.
From that night, the pool carries about three behaviour suites at once (about seven orgs each). This is a measurement from one incident, not a tested limit.
Proposed
Choose the pool's org range from the event that started the run.
| Run | Orgs today | Orgs proposed (starting point) |
|---|---|---|
merge_group |
halfsend-01 to -22, shared |
halfsend-01 to -14 |
pull_request, issue_comment, workflow_dispatch |
halfsend-01 to -22, shared |
halfsend-15 to -22 |
push to main (stage) |
halfsend |
unchanged |
The code already describes a pool as a range: PoolLayout{FirstOrgIndex, OrgCount, SlotsPerOrg} in pkg/behaviourtest/drivers/install/slotpool.go, and PoolLayoutForEnvironment picks the stage or dev layout. The change is:
- Let the dev layout take an optional org range from the environment (for example
BEHAVIOUR_POOL_FIRST_ORGandBEHAVIOUR_POOL_ORG_COUNT), validated to stay inside1..DevPoolOrgCount. Unset means the whole pool, as today, so local runs do not change. - In
.github/workflows/e2e.yml, set those two values fromgithub.event_namefor thebehaviourandplaybackjobs. - Check everything that is sized from the layout follows the range and not the full pool: test mint groups (
planCFMints,groupWorkflowHostRepos), the workflow-identity repo lists, garbage collection of stale slots, and the capacity error text. - Update the behaviour-testing guide: which runs use which orgs, and how to change the split.
Trade-offs to decide
- Each side gets a lower ceiling. With 14 and 8 orgs, the estimate is two queue suites and one pull-request suite at a time. A second concurrent pull-request suite would wait for slots or hit the quota sooner than it does today.
max_entries_to_buildshould match the queue's share. With a share of about two suites it should be 2, not 5. That is a separate one-line change to the branch ruleset and is needed with or without this split.- Alternative: more orgs. Adding orgs for the queue keeps pull-request capacity as it is, at the cost of setting up each org and extending the gateway and mint configuration.
- Alternative: cap pull-request suites with a concurrency group. No pool change, but GitHub keeps only one pending run per group and cancels the others, so pull-request runs would be cancelled, not queued.
Done when
- A
merge_grouprun and apull_requestrun started together claim repos only from their own org ranges (shown in both job logs). - With the range variables unset, the layout is the full pool and existing tests pass unchanged.
- An out-of-range or unparsable value fails the run at start with a message that names the variable.
- Unit tests cover the range parsing and that mint groups and repo lists are built from the range.
- The guide documents the split.
Related
- ci: E2E runs for discarded merge-queue groups keep running and exhaust the test orgs' API quota #9353: runs of discarded merge groups are not cancelled and keep using the pool.
- Behaviour tests: classify setup and rate-limit failures as infrastructure and retry once #8036: retrying a suite on an infrastructure failure.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
fullsend-ai-triage commentedon Nov 12, 2026
🤖 Finished Triage · ✅ Success · Started 12:37 PM UTC · Completed 12:38 PM UTC
Commit:
2a6db51· View workflow run →Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.15
fullsend-ai-triage commentedon Nov 12, 2026
Triage notes (net-new information only):
Fix targets verified. The layout code in
pkg/behaviourtest/drivers/install/slotpool.go(PoolLayout,PoolLayoutForEnvironment,DevPoolOrgCount), the mint-group helpers in the same package, thebehaviour/playbackjobs in.github/workflows/e2e.yml(already switching ongithub.event_name), and the behaviour-testing guide all exist as described.Workflow changes required. Step 2 of the proposal edits
.github/workflows/e2e.yml. The code agent cannot modify workflow files under current permissions, so it will not be auto-dispatched. A human PR or maintainer action is needed for that part. The Go changes (range parsing, validation, layout-derived mint groups and repo lists, GC) and the docs update can be done separately.No conflicting work found. No open PR addresses this. #9353 (cancelling discarded merge groups) and #8883 (pool expansion and concurrency) are complementary and don't block this. #8036 (infrastructure retry) is also complementary.
Open decision for maintainers. The 14/8 split and the
max_entries_to_buildvalue are stated as starting points. Implementing the range as configuration, not hardcoded policy, keeps that decision adjustable after merge.Proposed test case:
Next steps:
/fs-code— agent creates a PR to implement this issue/fs-code <your instruction>— agent implements with your specific guidanceifireball commentedon Nov 12, 2026
@waynesun09 IIRC there was wark being done to enable GitHub emulation, how far are we from that, if that is landing soon, perhaps we should make the pre-MQ BT use emulation and only let the MQ and STAGE BT use real orgs.
If we do implement this, I'd rather we use different org names, eg. halfsend-NN for PR tests, halfsand-NN for MQ tests.
waynesun09 commentedon Nov 12, 2026
@ifireball Short answer: emulation is not landing soon enough to replace the PR-stage pool, so the split is still needed now. Status of the two candidates, checked today:
vercel-labs/emulate (in-process API emulator)
createCommitOnBranch, no git over HTTP, no Actions variables or secrets public key (GitHub: GraphQLcreateCommitOnBranchmutation (feature request) vercel-labs/emulate#348 to feat(security): add unicode PostToolUse hook for runtime scanning #351, open, no replies), and it does not execute workflows.jctanner/github-emulator on the breadboard K3s stack (executes workflows)
What I'd suggest
max_entries_to_buildnow.On naming: separate org names per side (
halfsend-NNandhalfsand-NN) work for me. Do you mean new orgs for the queue, or renaming part of the existing 22? New orgs keep PR capacity as it is, at the cost of the per-org setup.jctanner commentedon Nov 12, 2026
The 32 GB figure is the breadboard Vagrantfile's allocation for the whole development stack — 26 pods including MLflow, observatory, org-pulse, markovd, three emulators (GitHub, GitLab, Jira), the dashboards and the runner. It is not the GitHub emulator's requirement.
Measured on that stack today: the
github-emulatorpod runs at ~250 Mi (k8s requests 512 Mi, limits 1536 Mi), and the entire namespace sums to under 4 Gi. An emulator-only deployment for PR-stage testing (emulator + Postgres + k3s + a runner) is a few GB and fits a 16 GB GitHub-hosted runner with room to spare, so a hosted emulator is not blocked on VM size.waynesun09 commentedon Nov 16, 2026
Update: pull-request behaviour tests on a GitHub emulator
Goal: Stop using the shared test-org pool on pull requests so only the merge queue leases from it.
Result (on a fork, nothing filed here yet)
contents: read, so it also runs on fork pull requests.Where to look
bt-emulator-host. The workflow isbehaviour-emulator.yml.ci-self-contained, pinned atc90fff5.0d2233d796b88cc90fff5c90fff5Reliability on real pull requests
We ported open pull requests from fullsend and agents to the forks and ran them through the job: 121 runs in two rounds. Each ported pull request shows its runs in the Checks tab:
No failure came from a pull request's change. The 9 failed runs have four causes:
How it works
Each job starts the emulator (jctanner/github-emulator), 12 real
actions/runnerprocesses, a locally built token mint, and one sandbox host on the same VM. A stub answers model calls.Target split
behaviour-emulator(new, includes playback)behaviourandplayback(live, all 97)A failure that only real GitHub can reveal then appears in the merge queue, not on the pull request. Maintainers can still run the live suite on a branch through its manual trigger.
What it needed
Decision asked of the team
Next, if the team agrees
behaviourandplaybackchecks on pull requests in one change.waynesun09 commentedon Nov 16, 2026
Update 2: the emulator job now takes about 9 to 10 minutes
Pull request feedback time matters, so we widened the job and shortened its start-up. This follows the first update. Everything is still on forks; nothing is filed here.
Result
behaviour-emulator, passes only when every shard and playback pass. The ruleset would name that one check, whatever the shard count.contents: readonly.Wall time runs from the first job start to the last job end. It excludes any wait for hosted runners.
Where to look
bt-emulator-hostat54451237d. The shard list ise2e/behaviour/emulator/shards.txt.ci-self-containedatd1d00d2, now 68 fixes.What made it faster
What sets the floor now
Emulator changes in this round
We landed 6 changes and checked each against github.com. These checks found and fixed 4 more differences from GitHub in the touched code: runner registration tokens, runner scope, raw-bytes file requests, and files of 1 MiB or more.
Unchanged from the first update
The scenario count (86 of 97), the reliability numbers, the two fixes worth landing first (the agents post-code broken-pipe exit and a pre-flight retry in fullsend), and the decision asked of the team remain unchanged.
waynesun09 commentedon Nov 17, 2026
Update 3: the whole suite in one job, and why shards help
Short answer to "why shards, and can one job run the suite in parallel?": one job works. On a 4-vCPU hosted runner it gets no more done past 2 to 3 scenarios in parallel. One job costs less than half the runner minutes of 16 shards, but takes about 38 minutes instead of about 10. The choice is feedback time against runner minutes.
We ran all 85 non-playback scenarios in one job and profiled it. Everything is still on forks; nothing is filed here.
Result
"Workers" below means scenarios running in parallel in one job.
Why more workers in one job do not help
Past 2 to 3 workers, the runner gets no more work done, and each scenario takes longer. CPU is not simply full: it is still idle about a quarter of the time. The emulator is the part that cannot run in parallel:
Disk, memory and network are not the limit. I/O wait stays under 2%, and there is no memory pressure and no swap.
What would make one job faster
Three emulator changes, which we have not made yet:
The emulator itself (Python and the git it starts) is about 40% of the CPU at 3 workers. Runners, checkout, the sandbox and the Go build make up the rest. So we expect these changes to cut one job from 35 to roughly 30 minutes of tests, and to stop 6 workers from being slower than 3. They would not bring one job near 10 minutes, and they would barely change the 16-shard time. That is our estimate; we have not measured it. A larger hosted runner (8 or 16 vCPUs) is the other option, also untried.
Where to look
bt-f1-io-probeatb93994fd6. A manual run withfeatures=allrepeats the comparison. It uses the same emulator build,d1d00d2.Unchanged from update 2
The 16-shard layout stays the proposal for pull requests. If the team prefers fewer runner minutes to faster feedback, the one-job layout works today with no other change.
waynesun09 commentedon Nov 17, 2026
The fixes that stand on their own on main are now four pull requests, tracked in #9607. All four are ready to merge and need only a maintainer approval.
nande, not onlyx5cfullsend runbinds the GitHub provider profiles and the OIDC host to the configured serverwaynesun09 commentedon Nov 23, 2026
Closing: the goal is met by a different route
This issue asked that pull-request runs stop using the API quota the merge queue needs. We did not split the pool by org range. Pull requests no longer use the pool at all: they run the behaviour suite on a GitHub emulator, as @ifireball suggested above. Follow-up work is in #9812.
What landed
behaviour-github-emulatorjob: 86 of 97 scenarios, about 9 minutes, no secrets, works on forksmain; livebehaviourandplaybackrun only in the merge queue and onmain/ok-to-test <sha> livefullsend-ai/agentsmade the same switchfullsend-ai/github-emulator, now at 2026.11.21 (#9776)Result so far
Not done, and why
BEHAVIOUR_POOL_FIRST_ORG,BEHAVIOUR_POOL_ORG_COUNT) is not needed while pull requests stay off the pool.max_entries_to_buildis 3, not the 2 proposed here. It matches the roughly 3 suites the pool carries.Moved to #9812
Queue failure signatures, #9353 and #9354, #9414 and #9420, #8883, #9154, the live check on agents
main, the slow agents job in pull-request runs, and #9756.