Files
cell/tests/actor_suspend_resume.ce

21 lines
571 B
Plaintext

// Test: actor is suspended by fast timer and resumed under slow timer,
// completing the computation correctly.
$receiver(function(msg) {
if (msg.sum == 12499997500000) {
print("PASS: actor suspended and resumed correctly")
} else {
print(`FAIL: expected 12499997500000, got ${msg.sum}`)
}
$stop()
})
$start(function(event) {
if (event.type == 'greet') {
send(event.actor, {count: 5000000, reply: $self})
}
if (event.type == 'disrupt') {
print("FAIL: actor was killed instead of completing")
$stop()
}
}, 'tests/slow_compute_actor')