Joystream / Joystream/joystream
Giza integration tests: Distributor node: Assets fetching flow
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 1.4k
- Forks
- 116
- PR merge metrics
- No merged PRs in 30d
Description
Preconditions:
- A running Joystream node
- A running query-node
- A running storage node which has sufficient limits set to handle the scenario
- A running distributor node which has sufficient limits set to handle the scenario
The flow:
-
Upload a big data object - maximum possible size can be used (for example, using a fixture like
SudoUploadDataObjector by creating a channel w/ the object as asset) -
Send requests to distributor node's
/assets/{objectId}endpoint:- Request A:
HEAD - Request B:
GETwith norangespecified - Request C:
HEAD - Request D:
GETwith norangespecified - Request E:
GETwithrangetargetting the first MB of the file - Request F:
GETwithrangetargetting the last MB of the file
Each request between
AandCshould be sent over a new connection, as soon as possible after response to the previous one
was recieved (the order must be preserved),
RequestsC-Fcan be sent simultaneously and the order in which they reach the distributor node does not matter.
The assumption is that all requests reach the distributor node before the data object fully downloaded into the distributor node cache. - Request A:
-
Verify the responses:
- Response A: Expect status 200 and
x-cache: missheader. - Response B: Expect status 200 and
x-cache: missheader. Expect other headers (cache-control,content-length) to match the ones inResponse A - Response C: Expect status 200 and
x-cache: pendingheader. - Response D: Expect status 200,
x-cache: pendingandx-data-source: localheader. Expect other headers (cache-control,content-length) to match the ones inResponse C - Response E: Expect status 206,
x-cache: pendingandx-data-source: localheader. - Response F: Expect status 206,
x-cache: pendingandx-data-source: externalheader.
- Response A: Expect status 200 and
-
Verify content of the responses matches the expected one
-
Continue sending
HEADrequests/assets/{objectId}untilx-cache: hitheader is recieved (set a reasonable timeout) -
Send the last
GETrequest toassets/{objectId}, confirmx-cache: hitandx-data-source: localheaders are recieved. Confirm other headers (cache-control,content-length) match the ones in the lastHEADrequest response. Optionally confirmmax-ageis set to predefined value (31536000)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the existing Giza integration tests and the distributor node's /assets/{objectId} entry point; use the SudoUploadDataObject fixture or channel asset flow to create the large object. Run the Joystream node, query-node, storage node, and distributor node, then implement the ordered and concurrent requests described. Done means response status, cache/data-source headers, metadata, content, ranges, and eventual cache hit are all verified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- api, backend, testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100