Changing assumptions

- The SyncedPlan no longer runs immediately if executed on the main
  thread.
- Update tests/names to reflect this change.
This commit is contained in:
Jozufozu 2024-01-22 14:37:30 -08:00
parent 59cb5f7dbf
commit 331c33b975

View File

@ -189,17 +189,21 @@ class PlanExecutionTest {
}
@Test
void mainThreadPlanRunsImmediately() {
void syncedPlanDefersOnMainThread() {
var done = new AtomicBoolean(false);
var plan = SyncedPlan.of(() -> done.set(true));
plan.execute(EXECUTOR, Unit.INSTANCE);
Assertions.assertFalse(done.get());
EXECUTOR.syncPoint();
Assertions.assertTrue(done.get());
}
@Test
void mainThreadPlanIsNotCalledOffThread() {
void syncedPlanDefersOffThread() {
var done = new AtomicBoolean(false);
var plan = SyncedPlan.of(() -> {