Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(plugin-odap-hermes): fix flaky recovery update test #2198

Closed
petermetz opened this issue Nov 11, 2022 · 1 comment · Fixed by #2205
Closed

test(plugin-odap-hermes): fix flaky recovery update test #2198

petermetz opened this issue Nov 11, 2022 · 1 comment · Fixed by #2205
Labels
bug Something isn't working Developer_Experience Flaky-Test-Automation Issues related to test stability (which is a long running issue that can never fully be solved) good-first-issue Good for newcomers good-first-issue-400-expert Hacktoberfest Hacktoberfest participants are welcome to take a stab at issues marked with this label. help wanted Extra attention is needed P3 Priority 3: Medium Tests Anything related to tests be that automatic or manual, integration or unit, etc.

Comments

@petermetz
Copy link
Member

Describe the bug

Flaky test case at: packages/cactus-plugin-odap-hermes/src/test/typescript/unit/recovery/recover-update.test.ts

To Reproduce

Run it as many times as it takes to make it randomly fail.

Expected behavior

Test case is stable and either always fails or always passes.

Logs/Stack traces

2022-11-10T22:36:39.3256956Z   ● Console
2022-11-10T22:36:39.3257123Z 
2022-11-10T22:36:39.3257240Z     console.log
2022-11-10T22:36:39.3259556Z       [2022-11-10T22:36:39.309Z] DEBUG (js-object-signer): Message to sign: "{\"sessionID\":\"e5e6ad7a-f96a-4ee5-ad37-df6cf2644657\",\"messageType\":\"urn:ietf:odap:msgtype:commit-transfer-complete-msg\",\"clientIdentityPubkey\":\"03a9bfad90a7e2d68a4742711a7361c0bad1eae49ec3666da3b48ba213930b04f1\",\"serverIdentityPubkey\":\"0242e8d5d0724f91eba46d14a3ed6f200e6363cc96d51f505aec3773e87861a789\",\"signature\":\"\",\"hashTransferCommence\":\"12bb958d3ea0ced7013fc9a07c7f442dcc5189d7fb5779d6b2cc5778ee1b58f1\",\"hashCommitFinalAck\":\"a55eec9b08af5d1607c59a508d8ea144517f47ce1010830f75716febbfe047fd\",\"sequenceNumber\":45}"
2022-11-10T22:36:39.3260697Z 
2022-11-10T22:36:39.3261325Z       at Logger.<anonymous> (node_modules/loglevel-plugin-prefix/lib/loglevel-plugin-prefix.js:106:24)
2022-11-10T22:36:39.3261601Z 
2022-11-10T22:36:39.3261700Z     console.info
2022-11-10T22:36:39.3262329Z       [2022-11-10T22:36:39.321Z] INFO (ServerGatewayHelper): TransferCompleteRequest passed all checks.
2022-11-10T22:36:39.3262576Z 
2022-11-10T22:36:39.3263325Z       at Logger.info (node_modules/loglevel-plugin-prefix/lib/loglevel-plugin-prefix.js:106:24)
2022-11-10T22:36:39.3263712Z 
2022-11-10T22:36:39.3338869Z 
2022-11-10T22:36:39.3339438Z Summary of all failing tests
2022-11-10T22:36:39.3340457Z FAIL packages/cactus-plugin-odap-hermes/src/test/typescript/unit/recovery/recover-update.test.ts (9.28 s)
2022-11-10T22:36:39.3343116Z   ● check valid built of recover update message
2022-11-10T22:36:39.3344439Z 
2022-11-10T22:36:39.3344790Z     expect(received).toBe(expected) // Object.is equality
2022-11-10T22:36:39.3345121Z 
2022-11-10T22:36:39.3345391Z     Expected: 3
2022-11-10T22:36:39.3345752Z     Received: 4
2022-11-10T22:36:39.3346023Z 
2022-11-10T22:36:39.3346253Z       261 |   }
2022-11-10T22:36:39.3346560Z       262 |
2022-11-10T22:36:39.3347076Z     > 263 |   expect(recoverUpdateMessage.recoveredLogs.length).toBe(3);
2022-11-10T22:36:39.3367037Z           |                                                     ^
2022-11-10T22:36:39.3370293Z       264 |
2022-11-10T22:36:39.3376302Z       265 |   await checkValidRecoverUpdateMessage(
2022-11-10T22:36:39.3381380Z       266 |     recoverUpdateMessage,
2022-11-10T22:36:39.3383692Z 
2022-11-10T22:36:39.3392079Z       at Object.<anonymous> (packages/cactus-plugin-odap-hermes/src/test/typescript/unit/recovery/recover-update.test.ts:263:53)
2022-11-10T22:36:39.3392409Z 
2022-11-10T22:36:39.3395037Z 

Complete CI log:

2022-11-10T21:04:27_cactus-plugin-odap-hermes_recover-update.test.crash.log

Screenshots

N/A

Cloud provider or hardware configuration:

GitHub Action Runner

Operating system name, version, build:

Ubuntu-20.04

Hyperledger Cactus release version or commit (git rev-parse --short HEAD):

v1.1.1

Hyperledger Cactus Plugins/Connectors Used

N/A

Additional context

This came up randomly while the tests were running for an unrelated PR.

cc: @RafaelAPB @AndreAugusto11

@petermetz petermetz added bug Something isn't working good-first-issue Good for newcomers help wanted Extra attention is needed Developer_Experience Hacktoberfest Hacktoberfest participants are welcome to take a stab at issues marked with this label. good-first-issue-400-expert Flaky-Test-Automation Issues related to test stability (which is a long running issue that can never fully be solved) Tests Anything related to tests be that automatic or manual, integration or unit, etc. P3 Priority 3: Medium labels Nov 11, 2022
@AndreAugusto11
Copy link
Contributor

@petermetz I'll take a look at that

AndreAugusto11 added a commit to AndreAugusto11/cacti that referenced this issue Nov 15, 2022
… the same database

* getLogsMoreRecentThanTimestamp() was returning more logs than supposed because
* both gateways were using the same database, instead of each having its own

Signed-off-by: André Augusto <andre.augusto@tecnico.ulisboa.pt>
AndreAugusto11 added a commit to AndreAugusto11/cacti that referenced this issue Nov 15, 2022
… same database

* getLogsMoreRecentThanTimestamp() was returning more logs than supposed because
* both gateways were using the same database, instead of each having its own

Signed-off-by: André Augusto <andre.augusto@tecnico.ulisboa.pt>
AndreAugusto11 added a commit to AndreAugusto11/cacti that referenced this issue Nov 15, 2022
… same database

* getLogsMoreRecentThanTimestamp() was returning more logs than supposed because
* both gateways were using the same database, instead of each having its own

Signed-off-by: André Augusto <andre.augusto@tecnico.ulisboa.pt>
petermetz pushed a commit to AndreAugusto11/cacti that referenced this issue Nov 20, 2022
… same database

* getLogsMoreRecentThanTimestamp() was returning more logs than supposed because
* both gateways were using the same database, instead of each having its own

Signed-off-by: André Augusto <andre.augusto@tecnico.ulisboa.pt>
petermetz pushed a commit that referenced this issue Nov 21, 2022
* getLogsMoreRecentThanTimestamp() was returning more logs than supposed because
* both gateways were using the same database, instead of each having its own

Signed-off-by: André Augusto <andre.augusto@tecnico.ulisboa.pt>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Developer_Experience Flaky-Test-Automation Issues related to test stability (which is a long running issue that can never fully be solved) good-first-issue Good for newcomers good-first-issue-400-expert Hacktoberfest Hacktoberfest participants are welcome to take a stab at issues marked with this label. help wanted Extra attention is needed P3 Priority 3: Medium Tests Anything related to tests be that automatic or manual, integration or unit, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants