Skip to content

Commit c11dd71

Browse files
committed
add comment describing test logic
1 parent e24fee7 commit c11dd71

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

core/src/core_tests/activity_tasks.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,6 +1307,20 @@ async fn heartbeat_response_can_be_paused() {
13071307
],
13081308
));
13091309

1310+
// The general testing pattern for each of these cases is:
1311+
// 1. Poll for activity task
1312+
// 2. Record activity heartbeat, get mocked heartbeat response
1313+
// 3. Sleep for 10ms (waiting for heartbeat request to be flushed)
1314+
// (i.e. sleep enough for the heartbeat flush interval to have elapsed)
1315+
// 4. Poll for activity task.
1316+
// We expect a cancellation activity task as they are prioritized (i.e. ordered before)
1317+
// regular activity tasks.
1318+
// 5. Assert that the received activity task is indeed a cancellation, with the reason
1319+
// we expect.
1320+
// 6. Complete the activity with a cancellation result.
1321+
//
1322+
// Repeat for subsequent test case(s).
1323+
13101324
// Test pause only
13111325
let act = core.poll_activity_task().await.unwrap();
13121326
core.record_activity_heartbeat(ActivityHeartbeat {

0 commit comments

Comments
 (0)