vmware / vmware/pinniped

testlib: invalid assumption about nil return from recover()

Open Beginner friendly
#776 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

chore priority/undecided
Dominant language
Go
Stars
739
Forks
85
Avg merge
5d 5h
Merged PRs (30d)
1

Description

This code is incorrect:

https://github.com/vmware-tanzu/pinniped/blob/c4d7e5c124ecacb39b01973538ea6bfd937eb950/test/testlib/assertions.go#L51-L52

because a test can fail with panic(nil).

The go std lib testing package handles this correctly.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in test/testlib/assertions.go at lines 51-52, then compare the behavior with the linked implementation in Go's testing package. Update the assertion handling so a test that calls panic(nil) is handled correctly, and verify that the relevant testlib behavior no longer treats that panic as no panic.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
testing
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.