-
Notifications
You must be signed in to change notification settings - Fork 11
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
Modify Profile Test to Fix Intermittent Failures #154
Conversation
Changed the profile test to use waitFor() instead of an await on findByText(). Occasionally, certain conditions caused findByText() to throw an error, likely due to the long load times for the imported controls in the profile viewer. The errors caused the tests to fail even though the code should pass. This change should resolve these errors as waitFor() retries getByText() until it does not throw an error, more resiliently handling the conditions that caused findByText() to throw errors.
Cleaned up the imports and addressed a couple linter issues.
Might need some help testing this one - this change seems to work but I may just be getting really lucky (unlucky?) with the tests passing all the time. Before the fix, the test giving a false negative was pretty rare, so if anyone sees that behavior occur again even with this change please drop a comment in this PR. |
I do not see any behavior occur during my testing. I think this should be good to go. |
Change the timeouts on the profile test to explicity be 5000ms. Before, the explicit timeout was longer than the default test timeout of 5000ms set by jest. This was causing a less descriptive error message to appear on a failed test. This change sets the timeouts to 5000ms and sets the overall test timeout to the slightly higher 6000ms in order to keep the optimal timeout time of 5000ms while also producing the correct error message on a failed timeout.
I noticed that you didn't use When testing the code for this branch, I did not see any profile test failures, but still am curious as to the above question. |
Good point. I only changed what was needed to fix the tests, but it would be better if the whole test was consistent. I'll make that change now. |
Modify the tests within the profile test to all use waitFor() so that the three tests are consistent with each other.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The profile test does not fail and everything seems good to go.
Added a missing `uuid` prop to component definition test data to resolve the "missing key prop" warning. The component ControlImplementationImplReq was expecting this uuid to be passed down so it can be used as the "key" in its list of elements, but it was missing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No test is failing. This looks good to me. Great work!
Changed the profile test to use waitFor() instead of an await
on findByText().
Occasionally, certain conditions caused findByText() to throw an error,
likely due to the long load times for the imported controls in the
profile viewer. The errors caused the tests to fail even though the
code should pass.
This change should resolve these errors as waitFor() retries getByText()
until it does not throw an error, more resiliently handling the
conditions that caused findByText() to throw errors.