From fcf2a73f82b9aaec1cf2541eba5c7e80926361d1 Mon Sep 17 00:00:00 2001 From: whitequark Date: Sat, 26 Mar 2016 22:28:22 +0000 Subject: [PATCH] test_pulse_rate: tighten upper bound to 1500ns. --- artiq/test/coredevice/test_rtio.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/artiq/test/coredevice/test_rtio.py b/artiq/test/coredevice/test_rtio.py index fdeda05c7..14d7b5d40 100644 --- a/artiq/test/coredevice/test_rtio.py +++ b/artiq/test/coredevice/test_rtio.py @@ -89,18 +89,19 @@ class PulseRate(EnvExperiment): @kernel def run(self): - dt = seconds_to_mu(1000*ns) + dt = seconds_to_mu(300*ns) while True: - try: - for i in range(1000): + for i in range(10000): + try: self.ttl_out.pulse_mu(dt) delay_mu(dt) - except RTIOUnderflow: - dt += 1 - self.core.break_realtime() + except RTIOUnderflow: + dt += 1 + self.core.break_realtime() + break else: self.set_dataset("pulse_rate", mu_to_seconds(2*dt)) - break + return class PulseRateDDS(EnvExperiment): @@ -254,7 +255,7 @@ class CoredeviceTest(ExperimentCase): rate = self.dataset_mgr.get("pulse_rate") print(rate) self.assertGreater(rate, 100*ns) - self.assertLess(rate, 2500*ns) + self.assertLess(rate, 1500*ns) def test_pulse_rate_dds(self): self.execute(PulseRateDDS)