Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[test] Use @pytest.mark.forked to fix test_without_init #1464

Merged
merged 8 commits into from
Jul 14, 2020

Conversation

archibate
Copy link
Collaborator

Related issue = close #1406 replace #1410

[Click here for the format server]


@xumingkuan I finally found a systematic solution for this while searching doc for #1462, could you try this out?

Copy link
Contributor

@xumingkuan xumingkuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It passed! Thank you very much.

@archibate archibate added the LGTM label Jul 12, 2020
@archibate
Copy link
Collaborator Author

Why AppVeyor failed test...

Traceback (most recent call last):
  File "C:\Users\appveyor\AppData\Roaming\Python\Python36\site-packages\py\_process\forkedfunc.py", line 110, in __del__
    if self.pid is not None:  # only clean up in main process
AttributeError: 'ForkedFunc' object has no attribute 'pid'

Did you meet this problem when running ti test or ti test runtime?

@xumingkuan
Copy link
Contributor

Why AppVeyor failed test...

Traceback (most recent call last):
  File "C:\Users\appveyor\AppData\Roaming\Python\Python36\site-packages\py\_process\forkedfunc.py", line 110, in __del__
    if self.pid is not None:  # only clean up in main process
AttributeError: 'ForkedFunc' object has no attribute 'pid'

Did you meet this problem when running ti test or ti test runtime?

Oh, yes I did. But the test passed while showing this message when running either ti test or ti test runtime.

@archibate
Copy link
Collaborator Author

Why AppVeyor failed test...

Traceback (most recent call last):
  File "C:\Users\appveyor\AppData\Roaming\Python\Python36\site-packages\py\_process\forkedfunc.py", line 110, in __del__
    if self.pid is not None:  # only clean up in main process
AttributeError: 'ForkedFunc' object has no attribute 'pid'

Did you meet this problem when running ti test or ti test runtime?

Oh, yes I did. But the test passed while showing this message when running either ti test or ti test runtime.

So does it return a non-zero exit code?

@xumingkuan
Copy link
Contributor

pytest-dev/pytest-forked#6

Looks like this is not solvable with pytest?

@archibate
Copy link
Collaborator Author

Does the latest commit (xfail) works for you?

@xumingkuan
Copy link
Contributor

Does the latest commit (xfail) works for you?

The message is the same (AttributeError: 'ForkedFunc' object has no attribute 'pid').

@archibate
Copy link
Collaborator Author

archibate commented Jul 13, 2020

Are you sure? f64c864? Fine, let me just skip this test on win.
Done, e8e9c8e, could you try this out?

@xumingkuan
Copy link
Contributor

Are you sure? f64c864? Fine, let me just skip this test on win.

Oh, this commit looks not to belong to this PR. I tried it but still AttributeError: 'ForkedFunc' object has no attribute 'pid'.

@xumingkuan
Copy link
Contributor

xumingkuan commented Jul 13, 2020

Are you sure? f64c864? Fine, let me just skip this test on win.
Done, e8e9c8e, could you try this out?

No, it doesn't work either. However, (of course) it works if I comment out @pytest.mark.forked...

@archibate
Copy link
Collaborator Author

Fine, let's just move this test to misc/...

Copy link
Contributor

@xumingkuan xumingkuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

misc/test_without_init.py Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jul 13, 2020

Codecov Report

Merging #1464 into master will increase coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1464      +/-   ##
==========================================
+ Coverage   66.88%   66.92%   +0.03%     
==========================================
  Files          38       38              
  Lines        5433     5421      -12     
  Branches      956      955       -1     
==========================================
- Hits         3634     3628       -6     
+ Misses       1636     1629       -7     
- Partials      163      164       +1     
Impacted Files Coverage Δ
python/taichi/lang/__init__.py 78.60% <ø> (-0.06%) ⬇️
python/taichi/lang/ops.py 93.12% <ø> (+0.27%) ⬆️
python/taichi/lang/util.py 64.70% <ø> (-0.21%) ⬇️
python/taichi/misc/error.py 14.28% <ø> (ø)
python/taichi/__init__.py 92.00% <100.00%> (+0.33%) ⬆️
python/taichi/lang/shell.py 40.67% <0.00%> (-3.39%) ⬇️
python/taichi/lang/ast_checker.py 74.28% <0.00%> (+2.06%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a63714c...63d7914. Read the comment docs.

@archibate archibate merged commit faff702 into taichi-dev:master Jul 14, 2020
@FantasyVR FantasyVR mentioned this pull request Jul 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Test] [bug] "test_runtime.py" failing on Windows
2 participants