Skip to content

Conversation

glbrntt
Copy link
Contributor

@glbrntt glbrntt commented Apr 15, 2025

Motivation:

The syscall abstraction layer tests aren't sendable clean.

Modifications:

  • Factor out the setup/teardown of SAL tests into a SALContext
  • SALContext a method to run a SAL test with two closues: one on the hooked event loop and another on the calling thread.
    • The EL bound closure is provided with the EL and locked boxes for the user ot kernel and kernel to user boxes.
    • The closure on the calling thread is provided with an 'assertions' object which provides a view over the hooked selector.
  • Note that there are still sendable holes in this code.
  • Refactored the tests to use these APIs.

Results:

Safer tests.

@glbrntt glbrntt added the semver/none No version bump required. label Apr 15, 2025
Motivation:

The syscall abstraction layer tests aren't sendable clean.

Modifications:

- Factor out the setup/teardown of SAL tests into a SALContext
- SALContext a method to run a SAL test with two closues: one on the
  hooked event loop and another on the calling thread.
  - The EL bound closure is provided with the EL and locked boxes for
    the user ot kernel and kernel to user boxes.
  - The closure on the calling thread is provided with an 'assertions'
    object which provides a view over the hooked selector.
- Note that there are still sendable holes in this code.
- Refactored the tests to use these APIs.

Results:

Safer tests.
Copy link
Contributor

@Lukasa Lukasa left a comment

Choose a reason for hiding this comment

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

Very nice work, this seems like a very meaningful improvement.

@Lukasa Lukasa enabled auto-merge (squash) April 16, 2025 10:17
@Lukasa Lukasa merged commit ae60dc3 into apple:main Apr 16, 2025
44 of 45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver/none No version bump required.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants