Skip to content

Conversation

scottmarchant
Copy link
Collaborator

@scottmarchant scottmarchant commented Jul 9, 2025

Quick summary

This PR adds a focused round of new and ported tests to harden the experimental DispatchAsync package:

  • New unit tests for AsyncSemaphore and DispatchTimeInterval cover edge-cases that weren’t exercised before.
  • Ports of libdispatch reference tests (dispatch_pingpong and dispatch_group) rewritten in Swift to stress-test queue/group behaviour under concurrency.
  • Stability fixes – cleans up a few flaky assertions and makes DispatchGroup.wait publicly visible so the new tests compile.
  • Minor doc tweaks / debug-print housekeeping.

PR Dependencies

This branch is stacked on PR #1 – “Initial implementation of many GCD API’s using Swift Concurrency.”
PR #1 will need merged before this PR.

@@ -70,7 +70,7 @@ extension DispatchAsync {
}
}

func wait() async {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure to hide whitespace changes before reviewing this. It will be a lot easier.

//
//===----------------------------------------------------------------------===//

// TODO: SM: Rename this file to AsyncSemaphoreTests (coming in next PR that adds tests)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note, this file was renamed to AsyncSemaphoreTests

Copy link

@JaapWijnen JaapWijnen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! More tests! 🎉

@scottmarchant scottmarchant force-pushed the feat/addAdditionalTests branch from ae42424 to a872ad4 Compare September 17, 2025 23: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