Skip to content

Commit 087eca0

Browse files
committed
smoke tests accept code 16: failure due to non-valid params - this is a failure due to params.
Signed-off-by: Jack Luar <[email protected]>
1 parent 734ff9c commit 087eca0

File tree

7 files changed

+16
-13
lines changed

7 files changed

+16
-13
lines changed

tools/AutoTuner/src/autotuner/distributed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ def main():
633633
# if all runs have failed
634634
if analysis.best_result[METRIC] == ERROR_METRIC:
635635
print("[ERROR TUN-0016] No successful runs found.")
636-
sys.exit(1)
636+
sys.exit(16)
637637
elif args.mode == "sweep":
638638
sweep()
639639

tools/AutoTuner/test/autotuner_test_utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535

3636
import os
3737

38+
# Accepted RC: success and failed with no valid results.
39+
accepted_rc = [0, 16]
40+
3841

3942
class AutoTunerTestUtils:
4043
@staticmethod

tools/AutoTuner/test/resume_check.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
import subprocess
3737
import os
3838
import time
39-
from .autotuner_test_utils import AutoTunerTestUtils
39+
from .autotuner_test_utils import AutoTunerTestUtils, accepted_rc
4040

4141
from contextlib import contextmanager
4242

@@ -108,7 +108,7 @@ def test_tune_resume(self):
108108
proc = subprocess.run("ray status", shell=True)
109109
no_nodes = proc.returncode != 0
110110
proc = subprocess.run("ray stop", shell=True)
111-
successful = proc.returncode == 0
111+
successful = proc.returncode in accepted_rc
112112

113113
if no_nodes and successful:
114114
break
@@ -117,7 +117,7 @@ def test_tune_resume(self):
117117
# Run the second config to completion
118118
print("Running the second config")
119119
proc = subprocess.run(self.commands[1], shell=True)
120-
successful = proc.returncode == 0
120+
successful = proc.returncode in accepted_rc
121121
self.assertTrue(successful)
122122

123123

tools/AutoTuner/test/smoke_test_algo_eval.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
import unittest
3636
import subprocess
3737
import os
38-
from .autotuner_test_utils import AutoTunerTestUtils
38+
from .autotuner_test_utils import AutoTunerTestUtils, accepted_rc
3939

4040
cur_dir = os.path.dirname(os.path.abspath(__file__))
4141
orfs_dir = os.path.join(cur_dir, "../../../flow")
@@ -75,7 +75,7 @@ def make_base(self):
7575
]
7676
for command in commands:
7777
out = subprocess.run(command, shell=True, check=True)
78-
self.assertTrue(out.returncode == 0)
78+
self.assertTrue(out.returncode in accepted_rc)
7979

8080
def test_algo_eval(self):
8181
if not (self.platform and self.design):
@@ -85,7 +85,7 @@ def test_algo_eval(self):
8585
for command in self.commands:
8686
print(command)
8787
out = subprocess.run(command, shell=True, check=True)
88-
successful = out.returncode == 0
88+
successful = out.returncode in accepted_rc
8989
self.assertTrue(successful)
9090

9191

tools/AutoTuner/test/smoke_test_sample_iteration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
import unittest
3636
import subprocess
3737
import os
38-
from .autotuner_test_utils import AutoTunerTestUtils
38+
from .autotuner_test_utils import AutoTunerTestUtils, accepted_rc
3939

4040
cur_dir = os.path.dirname(os.path.abspath(__file__))
4141

@@ -68,7 +68,7 @@ def test_sample_iteration(self):
6868
for command in self.commands:
6969
print(command)
7070
out = subprocess.run(command, shell=True, check=True)
71-
successful = out.returncode == 0
71+
successful = out.returncode in accepted_rc
7272
self.assertTrue(successful)
7373

7474

tools/AutoTuner/test/smoke_test_sweep.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
import subprocess
3737
import os
3838
import json
39-
from .autotuner_test_utils import AutoTunerTestUtils
39+
from .autotuner_test_utils import AutoTunerTestUtils, accepted_rc
4040

4141
cur_dir = os.path.dirname(os.path.abspath(__file__))
4242

@@ -80,7 +80,7 @@ def test_sweep(self):
8080
if not (self.platform and self.design):
8181
raise unittest.SkipTest("Platform and design have to be defined")
8282
out = subprocess.run(self.command, shell=True, check=True)
83-
successful = out.returncode == 0
83+
successful = out.returncode in accepted_rc
8484
self.assertTrue(successful)
8585

8686

tools/AutoTuner/test/smoke_test_tune.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
import unittest
3636
import subprocess
3737
import os
38-
from .autotuner_test_utils import AutoTunerTestUtils
38+
from .autotuner_test_utils import AutoTunerTestUtils, accepted_rc
3939

4040
cur_dir = os.path.dirname(os.path.abspath(__file__))
4141

@@ -64,7 +64,7 @@ def test_tune(self):
6464
if not (self.platform and self.design):
6565
raise unittest.SkipTest("Platform and design have to be defined")
6666
out = subprocess.run(self.command, shell=True, check=True)
67-
successful = out.returncode == 0
67+
successful = out.returncode in accepted_rc
6868
self.assertTrue(successful)
6969

7070

0 commit comments

Comments
 (0)