question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`AssertFunctionIsCalled` fails to unpatch target

See original GitHub issue

AssertFunctionIsCalled does not exit mock.patch if the assertion fails: https://github.com/cupy/cupy/blob/c0c99108b78f4480b17cdf22ba3e903eb65f3646/cupy/testing/helper.py#L1441-L1444

As a consequence, CI reports weird failures.

Example: https://jenkins.preferred.jp/job/chainer/job/daily_master_cupy-shuffled/378/ID=20,label=mn1-p100/consoleFull

  • The first failure is TestCubReduction_param_5_{backend='device', order='F', shape=(10, 20)}.test_cub_max on assert self.handle.call_count == int(self.times_called) in AssertFunctionIsCalled.__exit__.
  • The second failure is TestCubReduction_param_5_{backend='device', order='F', shape=(10, 20)}.test_cub_min on assert cupy_r.shape == numpy_r.shape, where cupy_r.shape == (), numpy_r.shape == (20,).

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
toslunarcommented, Nov 10, 2020

For record, the shuffle configuration (ID=20) in daily_master_cupy-shuffled/378 is

11:22:17 + ./run_cupy_combination_test.py --id 20
11:22:17 --- Shuffle Parameters ---
11:22:17 cuda_libs: ('cuda90', 'cudnn73-cuda9', 'nccl2.4-cuda9', 'none')
11:22:17 scipy: None
11:22:17 base: ubuntu16_py35
11:22:17 numpy: 1.18
11:22:17 --- Configuration ---
11:22:17 nccl: nccl2.4-cuda9
11:22:17 cutensor: none
11:22:17 cudnn: cudnn73-cuda9
11:22:17 base: ubuntu16_py35
11:22:17 cuda: cuda90
11:22:17 requires: ['numpy<1.19']
11:23:55 sha256:28646ab8950d2c4793c87a7631006aa0a7c063fd6ba98cfeef674f1c0dff3798
0reactions
takagicommented, Nov 10, 2020

Okay. Then I’ll merge #4233 with closing this issue, and post another that addresses the first issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

unittest.mock — mock object library — Python 3.11.1 ...
The function is called with the same arguments as the mock, and unless it returns DEFAULT , the return value of this function...
Read more >
mocked function is called but fails assert_called test
assert_called() is called, it throws: AssertionError: Expected 'mock_2' to have been called. I've tried several ways using patch and patch.
Read more >
RuntimeError: CUDA error: device-side assert triggered - GitHub
I did a pytorch and cuda downgrade to conda install pytorch=0.4.1 cuda90 -c pytorch, now it works. Any idea why the new versions...
Read more >
Troubleshooting a failed canary - Amazon CloudWatch
In the CloudWatch console, choose Canaries in the navigation pane and then choose the name of the canary to open the canary details...
Read more >
Frequently Asked Questions (FAQ)
The cgo program provides the mechanism for a “foreign function interface” to allow safe calling of C libraries from Go code. SWIG extends...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found