atsign-foundation / at_client_sdk

The Dart implementation of atSDK used for implementing Atsign's technology into other software
https://pub.dev/publishers/atsign.org/packages
BSD 3-Clause "New" or "Revised" License
1.46k stars 31 forks source link

sync multiple client functional test fails intermittently #1404

Closed murali-shris closed 1 month ago

murali-shris commented 1 month ago

Describe the bug

https://github.com/atsign-foundation/at_client_sdk/actions/runs/11007843917 sync_multiple_client_test.dart fails intermittently with the error

  INFO|2024-09-24 05:58:05.513521|SyncSystemTest|Server commit log: {public:signing_publickey@aliceđź› : [0, +], @aliceđź› :signing_privatekey@aliceđź› : [1, +], public:pkaminstalled@aliceđź› : [3, *], shared_key.bobđź› @aliceđź› : [11, *], @bobđź› :shared_key@aliceđź› : [12, *], public:location.wavi@aliceđź› : [15, *], public:image.wavi@aliceđź› : [19, *], public:city.wavi@aliceđź› : [20, *], public:foo.at_lookup_race_test@aliceđź› : [21, *], public:bar.at_lookup_race_test@aliceđź› : [22, *], public:baz.at_lookup_race_test@aliceđź› : [23, *], public:wavi-46050236.iphone.pkam.__pkams.__public_keys@aliceđź› : [25, +], public:wavi-946541363.iphone.pkam.__pkams.__public_keys@aliceđź› : [28, +], public:linkedin.wavi@aliceđź› : [558, *], public:testkey.wavi@aliceđź› : [565, *], public:fb_username-b4806309-d9e3-42c6-95bb-28e652a8992a@aliceđź› : [574, *], public:test.wavi@aliceđź› : [585, *], public:phone@aliceđź› : [586, *], public:email@aliceđź› : [587, *], public:location@aliceđź› : [588, *], public:publickey@aliceđź› : [590, *], phone-484848642.wavi@aliceđź› : [595, *], country-484848642.wavi@aliceđź› : [596, *], city-484848642.wavi@aliceđź› : [597, -], location-484848642.wavi@aliceđź› : [598, *]} 

  INFO|2024-09-24 05:58:05.514130|SyncSystemTest|mapEntry: MapEntry(phone-484848642.wavi@aliceđź› : {commitId: 595, commitOp: CommitOp.UPDATE_ALL}) 

  INFO|2024-09-24 05:58:05.514231|SyncSystemTest|mapEntry: MapEntry(location-484848642.wavi@aliceđź› : {commitId: 598, commitOp: CommitOp.UPDATE_ALL}) 

  INFO|2024-09-24 05:58:05.514296|SyncSystemTest|mapEntry: MapEntry(worknumber-484848642.wavi@aliceđź› : {commitId: 599, commitOp: CommitOp.UPDATE_ALL}) 
  NoSuchMethodError: The method '[]' was called on null.
  Receiver: null
  Tried calling: [](0)
  dart:core                                   Object.noSuchMethod
  test/sync_multiple_client_test.dart 424:42  assertCommitEntries
  test/sync_multiple_client_test.dart 156:24  main.<fn>
âś… test/atclient_putText_test.dart: (setUpAll)

Issue seems to be a key missing in sync response from server (worknumber-484848642.wavi in the above failure) Issue is not replicated in local run of functional tests

Steps to reproduce

Run github actions

Expected behavior

test should pass consistently

Screenshots

No response

Smartphones

Were you using an atApplication when the bug was found?

No response

Additional context

No response

murali-shris commented 1 month ago

Issue seems to be in metrics_impl.dart on server code atCommitLog!.getEntries(lastCommitIdReceived, regex: regex) returns max 25 entries(default limit) If there are commits greater than 25, then the test fails. I have fixed the issue by paginating till we retrieve all entries https://github.com/atsign-foundation/at_server/commit/d50f8f3abd7013cd99f23b81e2539e5985fcc45e