Skip to content

Commit 1bca991

Browse files
committed
Merge branch 'edge' into analyses-cli
2 parents d6a934b + 2a61803 commit 1bca991

File tree

74 files changed

+2188
-1376
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+2188
-1376
lines changed

abr-testing/abr_testing/tools/test_modules.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
async def tc_test_1(module: str, path_to_file: str) -> None:
1717
"""Thermocycler Test 1 Open and Close Lid."""
1818
duration = int(input("How long to run this test for? (in seconds): "))
19-
start = time.time()
20-
while time.time() - start < duration:
19+
start = time.monotonic()
20+
while time.monotonic() - start < duration:
2121
try:
2222
await (tc_open_lid(module, path_to_file))
2323
except asyncio.TimeoutError:
@@ -34,8 +34,8 @@ async def hs_test_1(module: str, path_to_file: str) -> None:
3434
"""Heater Shaker Test 1. (Home and Shake)."""
3535
duration = int(input("How long to run this test for? (in seconds): "))
3636
rpm = input("Target RPM (200-3000): ")
37-
start = time.time()
38-
while time.time() - start < duration:
37+
start = time.monotonic()
38+
while time.monotonic() - start < duration:
3939
try:
4040
await (hs_test_home(module, path_to_file))
4141
except asyncio.TimeoutError:

analyses-snapshot-testing/citools/generate_analyses.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ def start_containers(image_name: str, num_containers: int, timeout: int = 60) ->
125125
containers.append(container)
126126

127127
# Wait for containers to be ready
128-
start_time = time.time()
129-
while time.time() - start_time < timeout:
128+
start_time = time.monotonic()
129+
while time.monotonic() - start_time < timeout:
130130
all_ready = True
131131
for container in containers:
132132
exit_code, _ = container.exec_run(f"ls -al {CONTAINER_LABWARE}")
@@ -172,7 +172,7 @@ def analyze(protocol: TargetProtocol, container: docker.models.containers.Contai
172172
# Build the command with all relevant file paths
173173
all_files = [str(protocol.container_protocol_file)] + [str(lw) for lw in labware_files]
174174
command = f"python -I -m opentrons.cli analyze --json-output {protocol.container_analysis_file} " + " ".join(all_files)
175-
start_time = time.time()
175+
start_time = time.monotonic()
176176
result = None
177177
exit_code = None
178178
console.print(f"Beginning analysis of {protocol.host_protocol_file.name}")
@@ -191,7 +191,7 @@ def analyze(protocol: TargetProtocol, container: docker.models.containers.Contai
191191
protocol.set_analysis()
192192
return False
193193
finally:
194-
protocol.set_analysis_execution_time(time.time() - start_time)
194+
protocol.set_analysis_execution_time(time.monotonic() - start_time)
195195
console.print(f"Analysis of {protocol.host_protocol_file.name} completed in {protocol.analysis_execution_time:.2f} seconds.")
196196

197197

@@ -238,7 +238,7 @@ def get_container_instances(protocol_len: int) -> int:
238238

239239
def generate_analyses_from_test(tag: str, protocols: List[Protocol]) -> List[TargetProtocol]:
240240
"""Generate analyses from the tests."""
241-
start_time = time.time()
241+
start_time = time.monotonic()
242242
protocols_to_process: List[TargetProtocol] = []
243243
for test_protocol in protocols:
244244
host_protocol_file = Path(test_protocol.file_path)
@@ -256,6 +256,6 @@ def generate_analyses_from_test(tag: str, protocols: List[Protocol]) -> List[Tar
256256
)
257257
instance_count = get_container_instances(len(protocols_to_process))
258258
analyze_against_image(tag, protocols_to_process, instance_count)
259-
end_time = time.time()
259+
end_time = time.monotonic()
260260
console.print(f"Clock time to generate analyses: {end_time - start_time:.2f} seconds.")
261261
return protocols_to_process

0 commit comments

Comments
 (0)