CRUD concurrency tests

Offen
#1,582 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
35/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Bereich
backend, testing-qa

Rechercherichtung

Sieh dir den Branch des Pull Requests für die CRUD-Tests an, führe NSS im Multi-User-Modus auf localhost mit den aufgeführten Umgebungsvariablen aus und führe test/surface/concurrency.test.ts aus. Beginne mit den fehlschlagenden Concurrency-Fällen und vergleiche die beobachteten Responses und websocket-pubsub-Events mit den Erwartungen. Als abgeschlossen gilt die Aufgabe, wenn die Suite erfolgreich durchläuft, einschließlich genau einer erfolgreichen Erstellung und einer Benachrichtigung für jeden Fall mit wiederholtem PUT.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.
Vorherrschende Sprache
JavaScript
Sterne
1.8k
Forks
308
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus nodeSolidServer/node-solid-server

Alle Issues in nodeSolidServer/node-solid-server

Ähnliche Issues

Weitere Issues zu JavaScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.