Repository navigation
test(api): pin the export deadlines and an import's blank lines - #2253
Merged
Merged
Conversation
- Tests for an export cut by its overall deadline, an export out of time before its first row, and an import with blank lines. - An import line that is not one JSON object says an import is one JSON object per line. - The spec and the README state the export and import limits. - Two checks that could not change an answer are removed.
kanat
reviewed
Nov 23, 2026
kanat
left a comment
Collaborator
There was a problem hiding this comment.
Verdict: GO. Round 1 of #2253, head 876563a merged onto current main (8e6e0bc). No Blocker. One follow-up (R1.1), which does not block.
The four follow-ups from #2220 are closed:
- Each of the four mutants from #2220 R1.1 now fails a test: line deadline not capped at the hour (
TestAnExportCutAtItsDeadlineReadsAsBroken), context without the deadline and skipped 503 branch (TestAnExportOutOfTimeBeforeItsFirstRowIsToldToTryAgain), blank-line skip removed (TestAnImportWithBlankLinesIsRead). I also mutated the other side of the cap (line deadline = time left only):TestAnExportWhoseClientStopsReadingIsLetGofails. - #2220 R1.2: both removed checks cannot change an answer. The error-document deadline ran only when
written == 0, andencodewas never called then. FETCH on a done context fails on its own (the transaction is rolled back with it). - #2220 R1.4:
openapi.yamlequalsgo run ./cmd/openapi, andgenerated.shreports in step.go generate(sdks/go) anduv run generate.py(plugins/stream) leave no diff. The JS file passesnpm run types --check. No other SDK carries these strings. The README sentences match the code:maxExports = 4, 409, 503,exportWaitone hour,exportLineWaitone minute,maxImportLine64 MiB, 413. - #2220 R1.3: the 400 reads "this is not an export: an import is one JSON object per line: ..."; the wording itself is not pinned (R1.1).
Tests on the merged tree: TestDataMoveSuite in internal/api (49 pass) and internal/store pass. CI on the head: every check passes, including integration (api), integration (store), integration (router).
- [Should fix, follow-up] R1.1 —
datamove.go:216: the 400 wording is not pinned. Replacing the message with the old one ("this is not an export: "+err.Error()) passes the whole suite. Ready rows, checked to fail under that mutant and pass on head, inDataMoveSuite: (a) POST/v1/data/import?full=truewith each export line written byjson.MarshalIndent(line, "", " ")(one object over several lines): expect 400 andContains(failure, "one JSON object per line"); (b) the same export lines written withjson.Marshaland no newline between them (two objects on one line): same expectations.
Note: the PR also changes TestAnExportHungUpOnLetsGoAtOnce to seed its 20,000 rows in 20 statements of 1,000 (the PR text names the driver read timeout), which the PR body does not list. The test passes.
Nash0x7E2
pushed a commit
that referenced
this pull request
Nov 24, 2026
**Changes** - None to the router: two tests pin the 400 an import answers when a line is not one JSON object. **Tests** - `TestAnImportWithAnObjectOverSeveralLinesIsToldToWriteOnePerLine`: an export written with each line indented over several lines is answered 400, and the failure says "one JSON object per line". It fails when the failure is the parser's text alone (`"this is not an export: "+err.Error()`). - `TestAnImportWithTwoObjectsOnALineIsToldToWriteOnePerLine`: an export written with no newline between its lines is answered 400 with the same words. It fails under the same wording change. Follow-up to #2253 (Kanat's R1.1) Part of AI-3484
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.
Follow-up to #2220 (Kanat's review).
Changes
acceleration/README.mdstates the one export per app, the four exports per router, the hour and the minute per line, and the 64 MiB import line.Tests
TestAnExportCutAtItsDeadlineReadsAsBroken: an export cut by its overall deadline reads as a broken response with no cursor line. It fails when the line deadline is not capped by the overall one.TestAnExportOutOfTimeBeforeItsFirstRowIsToldToTryAgain: an export out of time before its first row is answered 503. It fails without the overall deadline, and with a 500 in place of the 503.TestAnImportWithBlankLinesIsRead: an import with blank lines between its lines writes every row. It fails when blank lines are not skipped.Part of AI-3484