OK, so I temporarily fix my script to prevent the error, but now I have a
more mysterious issue: looks like `loadTestsFromNames()` doesn't return?
I've modified `commands.py` like so:
import tests
loader = tests.Loader()
with open('/tmp/bar.txt','a') as fp:
fp.write('loader is {}\n'.format(loader))
try:
zzz = loader.loadTestsFromNames(['tests'])
with open('/tmp/bar.txt','a') as fp:
fp.write('DONE loading zzz= {}!\n'.format(zzz))
except Exception as exc:
with open('/tmp/bar.txt','a') as fp:
fp.write(str(exc))
runner = tests.Runner()
And here's attempt to run:
cauthu @ laptop:~/upstream-grpc/tools/run_tests$ cat /tmp/bar.txt
cat: /tmp/bar.txt: No such file or directory
cauthu @ laptop:~/upstream-grpc/tools/run_tests$
cauthu @ laptop:~/upstream-grpc/tools/run_tests$ ./run_tests.py -l python
--compiler python2.7 -r SanityTest
Unexpected error getting flaky tests: <type 'exceptions.ImportError'>
PASSED:
/home/cauthu/upstream-grpc/tools/run_tests/helper_scripts/build_python.sh
[time=1.8sec; retries=0:0]2017-09-21 13:36:47,390 detected port server
running version 20
2017-09-21 13:36:47,418 my port server is version 20
SUCCESS: All tests passed
cauthu @ laptop:~/upstream-grpc/tools/run_tests$
cauthu @ laptop:~/upstream-grpc/tools/run_tests$ cat /tmp/bar.txt
loader is <tests._loader.Loader object at 0x7f98821aca10>
cauthu @ laptop:~/upstream-grpc/tools/run_tests$
So it claims that all tests passed, there doesn't appear to be any
exception with `loadTestsFromNames`, and yet `DONE loading!` is not
appended to `/tmp/bar.txt`?
I'm super confused!? Any help appreciated. Thanks!
On Thu, Sep 21, 2017 at 12:47 PM, Giang Nguyen <[email protected]> wrote:
> Huh,
> Looks like the `loader.loadTestsFromNames(['tests'])` line is where
> things go wrong. I guess the `test_lite` is somehow passed to my test
> scripts, which do not expect it.
>
> mod = imp.load_module(fullname, self.file, self.filename, self.etc)
> File "/home/cauthu/upstream-grpc/src/python/grpcio_tests/tests/in
> terop/server_ssl_credentials_reload_test/greeter_client.py", line 25, in
> <module>
> server_ca_pem = open(sys.argv[1]).read()
> IOError: [Errno 2] No such file or directory: 'test_lite'
>
> I must be hooking into the test suites incorrectly. Looking...
>
>
>
>
> On Thu, Sep 21, 2017 at 12:32 PM, Giang Nguyen <[email protected]> wrote:
>
>> Ah I'm running into weird error: [Errno 2] No such file or directory:
>> 'test_lite' with all the tests:
>>
>>
>> 2017-09-21 12:10:35,113 START: /home/cauthu/upstream-grpc/too
>> ls/run_tests/helper_scripts/build_python.sh
>> Unexpected error getting flaky tests: <type 'exceptions.ImportError'>
>> 2017-09-21 12:10:35,116 WAITING: 0 queued, 1 jobs running, 0 complete, 0
>> failed
>> 2017-09-21 12:11:04,842 PASSED: /home/cauthu/upstream-grpc/too
>> ls/run_tests/helper_scripts/build_python.sh [time=29.7sec; retries=0:0]
>> 2017-09-21 12:11:04,847 detected port server running version 20
>> 2017-09-21 12:11:04,877 my port server is version 20
>> 2017-09-21 12:11:04,878 START: py27.test.unit._metadata_code_
>> details_test.MetadataCodeDetailsTest
>> 2017-09-21 12:11:04,881 START: py27.test.unit._channel_ready_
>> future_test.ChannelReadyFutureTest
>> 2017-09-21 12:11:04,884 START: py27.test.unit._cython._cancel
>> _many_calls_test.CancelManyCallsTest
>> 2017-09-21 12:11:04,888 START: py27.test.unit._cython.cygrpc_
>> test.InsecureServerInsecureClient
>> 2017-09-21 12:11:04,892 WAITING: 58 queued, 4 jobs running, 0 complete, 0
>> failed
>> 2017-09-21 12:11:06,956 ++ dirname /home/cauthu/upstream-grpc/too
>> ls/run_tests/helper_scripts/run_python.sh
>> + cd /home/cauthu/upstream-grpc/tools/run_tests/helper_scripts/../../..
>> ++ realpath py27/bin/python
>> + PYTHON=/home/cauthu/upstream-grpc/py27/bin/python2.7
>> ++ pwd
>> + ROOT=/home/cauthu/upstream-grpc
>> + /home/cauthu/upstream-grpc/py27/bin/python2.7
>> /home/cauthu/upstream-grpc/src/python/grpcio_tests/setup.py test_lite
>> running test_lite
>> I0921 12:11:05.660718415 6566 ev_epoll1_linux.c:93] grpc epoll
>> fd: 9
>> D0921 12:11:05.660756260 6566 ev_posix.c:107] Using
>> polling engine: epoll1
>> D0921 12:11:05.660795832 6566 dns_resolver.c:301] Using native
>> dns resolver
>> error: [Errno 2] No such file or directory: 'test_lite'
>>
>> 2017-09-21 12:11:06,957 FAILED: py27.test.unit._cython._cancel
>> _many_calls_test.CancelManyCallsTest [ret=1, pid=6558]
>> 2017-09-21 12:11:06,957 START: py27.test.unit._credentials_te
>> st.CredentialsTest
>> 2017-09-21 12:11:06,963 WAITING: ETA 127.1 sec; 57 queued, 4 jobs
>> running, 1 complete, 1 failed
>> 2017-09-21 12:11:06,969 ++ dirname /home/cauthu/upstream-grpc/too
>> ls/run_tests/helper_scripts/run_python.sh
>> + cd /home/cauthu/upstream-grpc/tools/run_tests/helper_scripts/../../..
>> ++ realpath py27/bin/python
>> + PYTHON=/home/cauthu/upstream-grpc/py27/bin/python2.7
>> ++ pwd
>> + ROOT=/home/cauthu/upstream-grpc
>> + /home/cauthu/upstream-grpc/py27/bin/python2.7
>> /home/cauthu/upstream-grpc/src/python/grpcio_tests/setup.py test_lite
>> running test_lite
>> I0921 12:11:05.662446075 6569 ev_epoll1_linux.c:93] grpc epoll
>> fd: 9
>> D0921 12:11:05.662486586 6569 ev_posix.c:107] Using
>> polling engine: epoll1
>> D0921 12:11:05.662526117 6569 dns_resolver.c:301] Using native
>> dns resolver
>> error: [Errno 2] No such file or directory: 'test_lite'
>>
>> In the end all test fail.
>>
>> Trying to looking into `class TestLite` in `commands.py`.
>>
>> Other tips? Thanks!
>>
>>
>> On Thu, Sep 21, 2017 at 11:18 AM, Giang Nguyen <[email protected]> wrote:
>>
>>> Ah, I don't/didn't have ccache. Good to know. Thanks!
>>>
>>> On Thu, Sep 21, 2017 at 10:11 AM, 'Nathaniel Manista' via grpc.io <
>>> [email protected]> wrote:
>>>
>>>> On Thu, Sep 21, 2017 at 9:32 AM, <[email protected]> wrote:
>>>>
>>>>> Ok so I find that I can run
>>>>>
>>>>> `tools/run_tests/run_tests.py -l python --compiler python2.7 -r <my
>>>>> test name>`
>>>>>
>>>>> I've added my test to `src/python/grpcio_tests/tests/interop` and
>>>>> updated the `tests.json` accordingly.
>>>>>
>>>>> Next question is, is there a flag to make `run_tests.py` not do
>>>>> `build_python.sh`? because the build step seems to recompile things
>>>>> everything, and that takes a while. I've just hacked the scripts to skip
>>>>> the build step after I build the first time, since I'm not modifying the
>>>>> library code, and just working on my test.
>>>>>
>>>>
>>>> Do you have ccache installed? Until we do away with build_python.sh
>>>> entirely <https://github.com/grpc/grpc/issues/8079>, using ccache in
>>>> our experience eliminates the
>>>> having-to-wait-ten-minutes-for-build_python.sh
>>>> step in most circumstances.
>>>>
>>>> Thank you for running the tests!
>>>> -Nathaniel
>>>>
>>>> --
>>>> You received this message because you are subscribed to a topic in the
>>>> Google Groups "grpc.io" group.
>>>> To unsubscribe from this topic, visit https://groups.google.com/d/to
>>>> pic/grpc-io/CGMnKNv199A/unsubscribe.
>>>> To unsubscribe from this group and all its topics, send an email to
>>>> [email protected].
>>>> To post to this group, send email to [email protected].
>>>> Visit this group at https://groups.google.com/group/grpc-io.
>>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>>> gid/grpc-io/CAEOYnARj7%3DYT489RKthTBtUKGd0kNJpA8%2BqSwAF--zM
>>>> zkY%3DPgw%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/grpc-io/CAEOYnARj7%3DYT489RKthTBtUKGd0kNJpA8%2BqSwAF--zMzkY%3DPgw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>
>>
>
--
You received this message because you are subscribed to the Google Groups
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit
https://groups.google.com/d/msgid/grpc-io/CAEryOqUdX53%3DmgX7CmvxWAT1MV4XUS_kdahgGiDFBe%2Br7F%2BgQQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.