Skip to content

Conversation

@mattcreaser
Copy link
Member

@mattcreaser mattcreaser commented Nov 4, 2025

  • PR title and description conform to Pull Request guidelines.

Issue #, if available:

Description of changes:
Improves the canary tests across categories with similar improvements that were added to the auth category in #3143

Generally this involved fixing two classes of issues:

  1. Running assertions (or calling fail) in callbacks from Amplify since these operate on background threads. Instead of failing the test such assertions will cause the test process to crash, losing any information about what went wrong.
  2. Using a CountdownLatch and not checking the return value of await. Such tests could cause various incorrect errors to be surfaced.

Both of these are generally addressed by using the Synchronous* test utility classes, which wrap Amplify calls to block the thread for results, propagate errors back to the calling thread, and internally do the proper handling of timeouts.

This may cause some tests to fail less often and, especially, should make any failures easier to diagnose. As an example, a device in Device Farm that is having connectivity issues would run in to issue (1) above, so the error in the test report would just be "test process crashed" - which may even be reported for a different test if (2) also came in to play. Now in this situation it will report the actual error that occurred (e.g. UnknownHostException) for the actual test that it happened in.

How did you test these changes?
Tests should pass.

Documentation update required?

  • No
  • Yes (Please include a PR link for the documentation update)

General Checklist

  • Added Unit Tests
  • Added Integration Tests
  • Security oriented best practices and standards are followed (e.g. using input sanitization, principle of least privilege, etc)
  • Ensure commit message has the appropriate scope (e.g fix(storage): message, feat(auth): message, chore(all): message)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@mattcreaser mattcreaser requested a review from a team as a code owner November 4, 2025 15:19
@codecov
Copy link

codecov bot commented Nov 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.69%. Comparing base (e7db5a7) to head (779c528).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3153      +/-   ##
==========================================
- Coverage   54.70%   54.69%   -0.01%     
==========================================
  Files        1046     1046              
  Lines       31251    31251              
  Branches     4690     4690              
==========================================
- Hits        17096    17093       -3     
- Misses      12330    12331       +1     
- Partials     1825     1827       +2     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mattcreaser mattcreaser enabled auto-merge (squash) November 5, 2025 15:05
@mattcreaser mattcreaser merged commit 75562b5 into main Nov 5, 2025
15 checks passed
@mattcreaser mattcreaser deleted the mattcreaser/canary-tests branch November 5, 2025 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants