diff --git a/artiq/firmware/runtime/session.rs b/artiq/firmware/runtime/session.rs index 59e3ed425..197ac00fc 100644 --- a/artiq/firmware/runtime/session.rs +++ b/artiq/firmware/runtime/session.rs @@ -508,7 +508,7 @@ fn process_kern_queued_rpc(stream: &mut TcpStream, let length = NetworkEndian::read_u32(slice) as usize; host_write(stream, host::Reply::RpcRequest { async: true })?; debug!("{:?}", &slice[4..][..length]); - stream.write(&slice[4..][..length])?; + stream.write_all(&slice[4..][..length])?; Ok(()) }) } diff --git a/artiq/test/coredevice/test_stress.py b/artiq/test/coredevice/test_stress.py new file mode 100644 index 000000000..a7037f156 --- /dev/null +++ b/artiq/test/coredevice/test_stress.py @@ -0,0 +1,29 @@ +import os +import time +import unittest + +from artiq.experiment import * +from artiq.test.hardware_testbench import ExperimentCase + + +artiq_low_latency = os.getenv("ARTIQ_LOW_LATENCY") + + +class _Stress(EnvExperiment): + def build(self): + self.setattr_device("core") + + @rpc(flags={"async"}) + def sink(self, data): + pass + + @kernel + def async_rpc(self, n): + for _ in range(n): + self.sink(b"") + + +class StressTest(ExperimentCase): + def test_async_rpc(self): + exp = self.create(_Stress) + exp.async_rpc(16000)