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.

Unit test failure

See original GitHub issue
self = <test_videoapi.TestVideoApi testMethod=test_frame_reading>

    @unittest.skipIf(av is None, "PyAV unavailable")
    def test_frame_reading(self):
        for test_video, config in test_videos.items():
            full_path = os.path.join(VIDEO_DIR, test_video)
    
            av_reader = av.open(full_path)
    
            if av_reader.streams.video:
                video_reader = VideoReader(full_path, "video")
                for av_frame in av_reader.decode(av_reader.streams.video[0]):
                    vr_frame = next(video_reader)
    
                    self.assertAlmostEqual(
                        float(av_frame.pts * av_frame.time_base),
                        vr_frame["pts"],
                        delta=0.1,
                    )
    
                    av_array = torch.tensor(av_frame.to_rgb().to_ndarray()).permute(
                        2, 0, 1
                    )
                    vr_array = vr_frame["data"]
                    mean_delta = torch.mean(
                        torch.abs(av_array.float() - vr_array.float())
                    )
                    # on average the difference is very small and caused
                    # by decoding (around 1%)
                    # TODO: asses empirically how to set this? atm it's 1%
                    # averaged over all frames
>                   self.assertTrue(mean_delta.item() < 2.5)
E                   AssertionError: False is not true

test/test_videoapi.py:97: AssertionError

https://app.circleci.com/pipelines/github/pytorch/vision/7915/workflows/82c134ae-52a5-4b83-8dbe-22d3f30ce3e5/jobs/561557

cc @bjuncek

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:14 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
datumboxcommented, May 21, 2021

It seems to me, that the magic elves fixed the issue during the night on the latest master…

1reaction
bjuncekcommented, May 19, 2021

Yeah I’m looking at it rn; still wasn’t able to reproduce it in any way; hopefully is something small.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why are unit tests failing seen as bad?
A test failure may indicate a planned feature under TDD which isn't yet implemented; or it may indicate a known issue which has...
Read more >
How to write good unit tests: Write failing tests first
To write reliable unit tests, always start writing a failing test. And make sure it fails for the right reasons. Follow the Red,...
Read more >
unittest — Unit testing framework — Python 3.11.1 ...
Unittest supports skipping individual test methods and even whole classes of tests. In addition, it supports marking a test as an “expected failure,”...
Read more >
How do you deal with failing unit tests? [closed] - Stack Overflow
What is the best way do deal with the failing unit tests? What I am currently doing is marking each failing test as...
Read more >
The Difference Between Failure and Error in JUnit | Baeldung
Both failure and error in JUnit tests indicate an undesired situation, but their semantics are different. Failures notify of an invalid test ...
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