-
I'm running into an issue where we are getting a great deal of random assertion failures do to the waiting for elements on our builds servers. It seems to be dependent on load but our build server and typically happens when more than one build is running (even ones that do not use bunit). Typically this manifests as a Find throwing an ElementNotFoundException. Rerunning the build after the load has died down often resolves the issue but is resulting in very poor build analytics. Is this expected? Is there anything that can be done to help mitigate this? Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 13 replies
-
Hey @groogiam. Of course builds should be as deterministic as possible. That said it is hard to help from here. What keeps me puzzled is that other unrelated tests are failing which seems to indicate some pressure on the build agent itself. That would explain also the timeout as it just takes longer to render components. Do you have any monitoring on your CI pipeline?Even if one bUnit test would go rogue I wouldn't expect other failing tests. |
Beta Was this translation helpful? Give feedback.
-
If you are getting bUnit has a bunch of methods to get around that:
The docs for We dont have docs for Hope this helps. |
Beta Was this translation helpful? Give feedback.
If you are getting
ElementNotFoundException
on tests that pass on your local machine but fail in CI, it's very likely you have asynchronous code in your components that execute slower in CI, and causes the timings of your test to be different.bUnit has a bunch of methods to get around that:
WaitForAssertion
WaitForState
WaitForElement/WaitForElements
(these are probably the ones you need instead ofFind
/FindAll
)The docs for
WaitForAssertion
explain the scenario's where you need those and the logic behind them: https://bunit.dev/docs/verification/async-assertion.We dont have docs for
WaitForElement/WaitForElements
yet, bit the basic logic behind them is the same, it's just the return …