Joystream / Joystream/joystream

Giza integration tests: Distributor node: Assets fetching flow

Open
#2,841 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

estimate-6h giza network-integration-test
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:

  1. Upload a big data object - maximum possible size can be used (for example, using a fixture like SudoUploadDataObject or by creating a channel w/ the object as asset)

  2. Send requests to distributor node's /assets/{objectId} endpoint:

    • Request A: HEAD
    • Request B: GET with no range specified
    • Request C: HEAD
    • Request D: GET with no range specified
    • Request E: GET with range targetting the first MB of the file
    • Request F: GET with range targetting the last MB of the file

    Each request between A and C should be sent over a new connection, as soon as possible after response to the previous one
    was recieved (the order must be preserved),
    Requests C-F can 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.

  3. Verify the responses:

    • Response A: Expect status 200 and x-cache: miss header.
    • Response B: Expect status 200 and x-cache: miss header. Expect other headers (cache-control, content-length) to match the ones in Response A
    • Response C: Expect status 200 and x-cache: pending header.
    • Response D: Expect status 200, x-cache: pending and x-data-source: local header. Expect other headers (cache-control, content-length) to match the ones in Response C
    • Response E: Expect status 206, x-cache: pending and x-data-source: local header.
    • Response F: Expect status 206, x-cache: pending and x-data-source: external header.
  4. Verify content of the responses matches the expected one

  5. Continue sending HEAD requests /assets/{objectId} until x-cache: hit header is recieved (set a reasonable timeout)

  6. Send the last GET request to assets/{objectId}, confirm x-cache: hit and x-data-source: local headers are recieved. Confirm other headers (cache-control, content-length) match the ones in the last HEAD request response. Optionally confirm max-age is set to predefined value (31536000)

Contributor guide

No contributing guide indexed for this repository

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.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.