Repository navigation
Ingestion integration tests run their own job, not whichever the shared queue offers - #256
Merged
Merged
Conversation
zlareb1
force-pushed
the
fix/ingest-tests-own-job
branch
4 times, most recently
from
November 4, 2026 11:18
e78cb03 to
450322d
Compare
…ed queue offers Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
… queue directly Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…ow a cross-tenant worker is tested Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…'s lease Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…spect sees it configured Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
… inspect test's assertion Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…elper names a job that did not run Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
zlareb1
force-pushed
the
fix/ingest-tests-own-job
branch
from
November 4, 2026 11:43
450322d to
3f52f8d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #157
A second failure in the same job, on main since the inspect tests landed:
test_knowledge_inspect_ingest.py::test_with_the_extractor_bad_content_lost_structure_and_a_refused_tokenasserts thatknowledge.inspectreports an extractor configured (ingestions.extractor_configured). That is the server's own setting, and CI started the reference extractor after the servers booted, so only the test process had its URL.Changelog category (leave one):
Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):
...
Why
tests/integration/test_knowledge_ingest_live.pyfails intermittently in the integration job. Which tests fail changes from run to run:test_revisions_count_up_and_an_expected_revision_guards_the_publishreads revision 1 where it expects 2;test_an_uploaded_sql_file_is_parsed_published_and_citedandtest_a_mislabelled_upload_is_stored_and_the_extractor_refuses_itread their job stillpending.In every failure, the job the test created was never run. Each test calls
knowledge_ingest'srun_pass()once and then reads the result, but a pass runs exactly one job, chosen from the whole queue.ingestions.dueorders that queue fairly across namespaces, namespaces never served first. The integration job runs every test file against one ClickHouse, and other files (the inspect tests among them) leave jobs in it. So the one pass often takes another test's job.Change
ingest_run.take_and_run. That is the call a worker pass makes once it has taken a job, so the test exercises the same lease, re-read and stages, and no longer depends on what else is queued.test_knowledge_ingest_live.py,_worknow takes the job's org, namespace and id.test_namespace_tune_documents.py's helper, which looped over up to ten passes, runs its own job the same way.test_knowledge_inspect_ingest.py, the bounded loop of passes in_workis replaced by the same own-job run; with more than ten jobs queued ahead, that loop failed the same way._endcleanup cancels its open jobs and runs each one, which ends it. A run does not wait for a retried job's next attempt. The cleanup used to poll up to 60 passes of the shared queue.docs/development/testing.mdsays how a worker whose pass reads a cross-tenant queue is exercised, and that the publishing tests run their own job.take_and_runreturns None when it ran nothing), so a job not run reads as that, not as a wrong state later..github/workflows/ci.ymlstarts the reference extractor before both servers boot, so they readLOOM_DOCUMENT_EXTRACTOR_URLand its token from the job's environment as the test process does.tests/integration/test_knowledge_ingest_queue.pyalready readsingestions.duedirectly;test_each_namespace_offers_one_due_job_at_the_head_of_its_sourcejoins it, built from rows as its neighbours are: one candidate per namespace, the job due longest among its sources' first open jobs, and a source's later job held behind the earlier one even while that one waits out a retry delay (the per-namespace rule, which the backlog test there cannot tell from the per-source one, included). Removing eitherLIMIT 1 BYfromduefails it. Its rows are ended after, so it leaves nothing on the queue.Compatibility, rollout and rollback
Tests
test_knowledge_ingest_live.pyas on main fails three tests, the way the CI runs do.test_knowledge_ingest_live.py,test_knowledge_inspect_ingest.py,test_namespace_tune_documents.pyandtest_knowledge_ingest_queue.pypass: 11 passed.make format-checkandmake lintpass.AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated (an agent wrote most of the diff): Claude Code.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make format-check,make lint,make typecheckandmake test-unitpass; the integration suite passes if server behaviour changed. (Test-only; the two files pass locally under a queued backlog, and the integration job on this PR runs them.)docs/describe the system as it now is, and this description names any operator steps and wire changes.tests/unit/test_public_copy.py).git commit -s), as CONTRIBUTING.md asks.🤖 Generated with Claude Code