Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

[Question] Isolation level between test targets within the same project. #2729

Closed
Abdulmajeed-Alzoubi opened this issue Nov 10, 2022 · 1 comment

Comments

@Abdulmajeed-Alzoubi
Copy link

Abdulmajeed-Alzoubi commented Nov 10, 2022

Hi, in case we run buck test ... for a specific project which has, let's say, 10 test targets. Then buck will run/execute all the 10 targets in parallel (assuming we have enough threads), where each target is assigned to a single thread.

The question is about the isolation level between the processes that execute each test target.

  1. Can different targets share a common memory -> so the code MUST be thread safe in this case?
  2. Or is it guaranteed that different targets have different view of the memory, so the bytes needed for one target will be just used for that target, but none of the others even in the case where we have common dependencies (common util class, common objects, etc.)?

The purpose of this question is to know if splitting one test target to multiple targets could cause any race condition, if the test code itself was not written in a thread-safe manner.

@Abdulmajeed-Alzoubi
Copy link
Author

The answer is different targets are executed in different JVM, so no static common states (shared objects), but external states is shared like filesystem and network.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant