Skip to content

Commit 72cd2e8

Browse files
committed
fix tests, less iterations
1 parent dd320fc commit 72cd2e8

File tree

6 files changed

+10
-9
lines changed

6 files changed

+10
-9
lines changed

experiment/trivial/instrumented.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ def run() -> None:
66
with persist.Loader(__file__, locals()) as transaction:
77
if transaction:
88
[i] = transaction.move()
9-
for i in transaction.iterate(range(1000)): # type: int
9+
for i in transaction.iterate(range(100)): # type: int
1010
pass
1111
transaction.commit(i)
1212

experiment/trivial/main.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
def run() -> None:
22
"""Trivial baseline"""
3-
for i in range(1000): # type: int
3+
for i in range(100): # type: int
44
pass
55

66

experiment/trivial/naive.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33

44
def run() -> None:
55
"""Trivial baseline"""
6+
[i] = (None,) * 1
67
with persist.Loader(__file__, locals()) as transaction:
78
if transaction:
89
[i] = transaction.move()
9-
for i in transaction.iterate(range(1000)): # type: int
10+
for i in transaction.iterate(range(100)): # type: int
1011
pass
1112
transaction.commit(i)
1213

experiment/trivial/vm.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
def run() -> None:
55
"""Trivial baseline"""
66
with persist.SimpleTcpClient("trivial") as client:
7-
for i in client.iterate(range(1000)): # type: int
7+
for i in client.iterate(range(100)): # type: int
88
pass
99
client.commit()
1010

tests/test_generate.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ def compare_transformed_files(actual: str, expected_outfile: pathlib.Path) -> No
1818
expected = expected_outfile.read_text(encoding="utf-8")
1919
expected_transaction = find_transaction(expected)
2020
actual_transaction = find_transaction(actual)
21-
assert actual_transaction == expected_transaction
2221
assert actual == expected
22+
assert actual_transaction == expected_transaction
2323

2424

2525
def naive_transform(filename: pathlib.Path, expected_outfile: pathlib.Path) -> None:

tests/test_instrument.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1+
import pathlib
2+
13
from checkpoint import persist
24

35

46
def instrument_experiment(experiment_name: str, args: list[str]) -> None:
57
def run(fuel: int) -> str:
8+
instrumented = pathlib.Path("experiment") / experiment_name / "instrumented.py"
69
return persist.run_instrumented_file(
7-
instrumented=f"experiment/{experiment_name}/instrumented.py",
8-
args=args,
9-
fuel=fuel,
10-
capture_stdout=True,
10+
instrumented=instrumented, args=args, fuel=fuel, capture_stdout=True
1111
)
1212

1313
expected = run(10**6)

0 commit comments

Comments
 (0)