status-im / status-mobile

a free (libre) open source, mobile OS for Ethereum
https://status.app
Mozilla Public License 2.0
3.89k stars 984 forks source link

PR contract tests are failing randomly #19256

Open Parveshdhull opened 7 months ago

Parveshdhull commented 7 months ago

https://ci.status.im/blue/organizations/jenkins/status-mobile%2Fprs%2Ftests/detail/PR-19089/4/pipeline/

related discussion: https://discord.com/channels/1210237582470807632/1217173160416382986/1217812191194124439

Logs: test-logs.txt

Parveshdhull commented 6 months ago

image

https://ci.status.im/blue/organizations/jenkins/status-mobile%2Fprs%2Ftests/detail/PR-19274/11/pipeline Latest Logs: log.txt

cc @cammellos

Parveshdhull commented 6 months ago

related PR https://github.com/status-im/status-mobile/pull/19362 @siddarthkay

siddarthkay commented 6 months ago

So this is not a timeout issue. we need to fix the Integration test. Will share more findings here

mohsen-ghafouri commented 6 months ago

pipeline link are not valid anymore. do we have any new link? @Parveshdhull @siddarthkay .

I got this error locally:

FAIL in (wallet-get-walet-token-test) (tests/contract_test/wallet_test.cljs:73:11)
expected: (contains? (:marketValuesPerCurrency token) :usd)
  actual: (not (contains? nil :usd))
Parveshdhull commented 6 months ago

hi @mohsen-ghafouri, Thank you for picking the issue.

Latest link: https://ci.status.im/blue/organizations/jenkins/status-mobile%2Fprs%2Ftests/detail/PR-19430/2/pipeline

mohsen-ghafouri commented 6 months ago

currently contract tests behave very randomly, different result on multiple try, result are either:

cammellos commented 6 months ago

from https://ci.status.im/blue/rest/organizations/jenkins/pipelines/status-mobile/pipelines/prs/pipelines/tests/branches/PR-19430/runs/2/log/?start=0

seems like the RPC error might be a red-herring.

It seems like it's just caused by the fact that we logout/'create an account much faster then normal app usage, and we receive a signal while the app is in the process of logging in from a previous session, but that should not be a problem, although other kind of signals might be I suppose, but in this case looks like it's fine, since it's just failing on some random commnunity requests

mohsen-ghafouri commented 6 months ago

If we run contract test file separately, we won't see any issue, but when we run all test sometimes it throws timeout error. I had the same issue with integration test whenever I didn't add logout logic at the end of my test. so here it seems some test doesn't logout respectfully. logout logic coupled with test-async and a bit hard to debug

siddarthkay commented 6 months ago

https://github.com/status-im/status-mobile/pull/19362 just adds logs to wait-for implementation and before/after logout was called. This may help in future to investigate incase tests start timing out again..