nodeSolidServer / nodeSolidServer/node-solid-server
CRUD concurrency tests
未关闭
还没有人认领这个 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.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 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