marxin / cvise

Super-parallel Python port of the C-Reduce
Other
220 stars 25 forks source link

Moving input file in test? #51

Closed aytey closed 3 years ago

aytey commented 3 years ago

I just added something like:

mv unit.cpp test.cpp

to my interestingness test, where unit.cpp is the input name as given to cvise.

However, this then led to:

00:00:03 DEBUG ***ADVANCE*** from 31 to 32 with chunk 1
Traceback (most recent call last):
  File "/usr/bin/cvise", line 286, in <module>
    reducer.reduce(pass_group, skip_initial=args.skip_initial_passes)
  File "/usr/share/cvise/cvise.py", line 143, in reduce
    self._run_additional_passes(pass_group['first'])
  File "/usr/share/cvise/cvise.py", line 166, in _run_additional_passes
    self.test_manager.run_pass(p)
  File "/usr/share/cvise/utils/testing.py", line 521, in run_pass
    self.process_result(success_env)
  File "/usr/share/cvise/utils/testing.py", line 546, in process_result
    shutil.copy(test_env.test_case_path, self.current_test_case)
  File "/usr/lib64/python3.8/shutil.py", line 418, in copy
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/lib64/python3.8/shutil.py", line 264, in copyfile
    with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: '/mnt/baranem/cvise-g1_ch4r0/cvise-952vdbgu/unit.cpp'

and cvise couldn't do anything (this was with cvise --version == cvise 2.3.0).

There's a good chance this is "play stupid games, win stupid prizes", but I'm creating this issue in case other people come across it.

marxin commented 3 years ago

Yeah, it's an unlikely issue I'm not planning to address. Thanks for the report.

aytey commented 3 years ago

I'm not saying this needs to be fixed, but maybe (and I can do a PR for this if you're interested), we could do something like:

try:
     shutil.copy(test_env.test_case_path, self.current_test_case)
except FileNotFoundError:
    raise RuntimeError("Can't find {:s} -- did your interestingness test move it?".format(self.current_test_case))

(written in the browser, so might not be perfect code)

At least then it could make it clear to people what the issue is.

We do agree though, this isn't a big deal to me ...

marxin commented 3 years ago

Thanks for help, I pushed the change.