nodeSolidServer / nodeSolidServer/node-solid-server

CRUD concurrency tests

未關閉
#1,582 3 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
JavaScript
星號
1.8k
分支
308
PR 合併指標
30 天內沒有已合併 PR

描述

See https://github.com/solid/solid-crud-tests/pull/47, check out that branch of the CRUD tests.
Run NSS in multi-user mode on localhost. Then:

export OIDC_ISSUER_ALICE=https://localhost:8443
export STORAGE_ROOT=https://alice.localhost:8443
export ALICE_WEBID=${STORAGE_ROOT}/profile/card#me

export USERNAME_ALICE=alice
export PASSWORD_ALICE=123
export CURL_RESULT_ALICE=`curl -ki $OIDC_ISSUER_ALICE/login/password -d"username=$USERNAME_ALICE&password=$PASSWORD_ALICE" | grep Set-Cookie`
export COOKIE_ALICE=`expr "$CURL_RESULT_ALICE" : '^Set-Cookie:\ \(.*\).'`

export NODE_TLS_REJECT_UNAUTHORIZED=0

./node_modules/.bin/jest test/surface/concurrency.test.ts

 FAIL  test/surface/concurrency.test.ts
  ● Concurrency › Try to create the same resource, using PUT 10 times › succeeds exactly once

    expect(received).toEqual(expected) // deep equality

    Expected: 1
    Received: 10

      88 |         results.filter((result) => responseCodeGroup(result.status) === "2xx")
      89 |           .length
    > 90 |       ).toEqual(1);
         |         ^
      91 |     });
      92 |     it("creates the resource", async () => {
      93 |       const result = await authFetcher.fetch(resourceUrl);

      at Object.<anonymous> (test/surface/concurrency.test.ts:90:9)

  ● Concurrency › Try to create the same resource, using PUT 10 times › emits websockets-pubsub on the container exactly once

    expect(received).toEqual(expected) // deep equality

    Expected: 1
    Received: 10

      115 |           (x) => x === `pub ${containerUrl}`
      116 |         ).length
    > 117 |       ).toEqual(1);
          |         ^
      118 |     });
      119 |     ifWps("emits websockets-pubsub on the resource exactly once", () => {
      120 |       expect(

      at Object.<anonymous> (test/surface/concurrency.test.ts:117:9)

  ● Concurrency › Try to create the same resource, using PUT 10 times › emits websockets-pubsub on the resource exactly once

    expect(received).toEqual(expected) // deep equality

    Expected: 1
    Received: 10

      122 |           (x) => x === `pub ${resourceUrl}`
      123 |         ).length
    > 124 |       ).toEqual(1);
          |         ^
      125 |     });
      126 |   });
      127 |   describe("Use PATCH 10 times to add triple to the same resource", () => {

      at Object.<anonymous> (test/surface/concurrency.test.ts:124:9)

Test Suites: 1 failed, 1 total
Tests:       3 failed, 6 passed, 9 total
Snapshots:   0 total
Time:        11.794 s
Ran all test suites matching /test\/surface\/concurrency.test.ts/i.

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

查看 CRUD 測試的 pull request 分支,使用列出的環境變數在 localhost 上以多使用者模式執行 NSS,並執行 test/surface/concurrency.test.ts。從失敗的並行案例開始,將觀察到的回應和 websocket-pubsub 事件與預期進行比較。完成的標準是測試套件通過,包括每個重複 PUT 案例恰好一次成功建立和一次通知。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
javascript, typescript
領域
backend, testing-qa
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。