android_packages_modules_Co.../tests
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Junyu Lai 33bb7fbfb7 Refactor requestNetworkAndGenerateTraffic by using synchronized methods
This is a refactoring of the test to adopt synchronized methods.
This is needed for the follow-up changes to get attributes of
the network prior to generating the network traffic.

This change includes:
  1. Use synchronized methods in AutoReleaseNetworkCallbackRule for
     better managing request/release networks and also improves
     readability.
  2. Decouple the steps of requesting network, set attributes and
     generating network traffic.
  3. Clearer fail messages since the test can directly throw exceptions
     to reflect the failures of a specific procedure.
  4. Remove the global timeout, which makes the test more likely
     to be flaky when individual steps take longer to complete.
  5. Use capabilities in the callback instead of synchronous calls to
     fetch attributes.
  6. Use @RestoreDefaultNetwork annotation to enforce default network
     restoration.

Test: atest CtsNetTestCases:android.net.cts.NetworkStatsManagerTest \
      --rerun-until-failure 30
Bug: 368624224
Change-Id: I3effa3c032afb345f1c0c4b73b51397d18970a19
2024-10-16 16:49:38 +08:00
..
benchmark [DON'T BLOCK] Test ownership migration rules 2024-01-31 14:10:00 +00:00
common Support NetworkStats#addEntries API 2024-08-09 14:19:38 +08:00
cts Refactor requestNetworkAndGenerateTraffic by using synchronized methods 2024-10-16 16:49:38 +08:00
deflake [DON'T BLOCK] Test ownership migration rules 2024-01-31 14:10:00 +00:00
integration Make java_sdk_library dependencies explicit 2024-09-10 00:01:31 +00:00
native Fix dependencies on connectivity_native lib 2024-07-31 00:39:50 +00:00
smoketest [DON'T BLOCK] Test ownership migration rules 2024-01-31 14:10:00 +00:00
unit Fix the test flake in testRemoveServicesAfterSocketDestroyed 2024-09-26 05:56:28 +00:00