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

fix: don't panic on unknown scenario name #230

Merged
merged 2 commits into from
May 3, 2024
Merged

Conversation

nvloff-f3
Copy link
Contributor

When a scenario that was not added is called via CLI - f1 paniced:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x104a8d114]

goroutine 1 [running]:
github.com/form3tech-oss/f1/v2/internal/run.NewActiveScenario(0x0, 0x1400020c5a0)
	/Users/nikolayvladimirov/go/src/github.com/form3tech-oss/f1/internal/run/active_scenario.go:33 +0x24
github.com/form3tech-oss/f1/v2/internal/run.(*Run).Do(0x14000244000, {0x104cb02f0, 0x1400003e280}, 0x14000064020)
	/Users/nikolayvladimirov/go/src/github.com/form3tech-oss/f1/internal/run/test_runner.go:121 +0x1b8
github.com/form3tech-oss/f1/v2/internal/run.Cmd.runCmdExecute.func1(0x1400020ef08, {0x1400003e370, 0x1, 0x5?})
	/Users/nikolayvladimirov/go/src/github.com/form3tech-oss/f1/internal/run/run_cmd.go:158 +0x570
github.com/spf13/cobra.(*Command).execute(0x1400020ef08, {0x1400003e320, 0x5, 0x5})
	/Users/nikolayvladimirov/go/pkg/mod/github.com/spf13/[email protected]/command.go:983 +0x840
github.com/spf13/cobra.(*Command).ExecuteC(0x1400020e008)
	/Users/nikolayvladimirov/go/pkg/mod/github.com/spf13/[email protected]/command.go:1115 +0x344
github.com/spf13/cobra.(*Command).Execute(...)
	/Users/nikolayvladimirov/go/pkg/mod/github.com/spf13/[email protected]/command.go:1039
github.com/spf13/cobra.(*Command).ExecuteContext(...)
	/Users/nikolayvladimirov/go/pkg/mod/github.com/spf13/[email protected]/command.go:1032
github.com/form3tech-oss/f1/v2/pkg/f1.(*F1).execute(0x14000039e50, {0x0, 0x0, 0x0})
	/Users/nikolayvladimirov/go/src/github.com/form3tech-oss/f1/pkg/f1/f1.go:106 +0x16c
github.com/form3tech-oss/f1/v2/pkg/f1.(*F1).Execute(0x14000039e50?)
	/Users/nikolayvladimirov/go/src/github.com/form3tech-oss/f1/pkg/f1/f1.go:123 +0x28
main.main()
	/Users/nikolayvladimirov/go/src/github.com/form3tech-oss/f1/benchcmd/main.go:9 +0x13c
Screenshot 2024-05-02 at 10 44 06

When a scenario that was not added is called via CLI - f1 paniced:
```
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x104a8d114]

goroutine 1 [running]:
github.com/form3tech-oss/f1/v2/internal/run.NewActiveScenario(0x0, 0x1400020c5a0)
	/Users/nikolayvladimirov/go/src/github.com/form3tech-oss/f1/internal/run/active_scenario.go:33 +0x24
github.com/form3tech-oss/f1/v2/internal/run.(*Run).Do(0x14000244000, {0x104cb02f0, 0x1400003e280}, 0x14000064020)
	/Users/nikolayvladimirov/go/src/github.com/form3tech-oss/f1/internal/run/test_runner.go:121 +0x1b8
github.com/form3tech-oss/f1/v2/internal/run.Cmd.runCmdExecute.func1(0x1400020ef08, {0x1400003e370, 0x1, 0x5?})
	/Users/nikolayvladimirov/go/src/github.com/form3tech-oss/f1/internal/run/run_cmd.go:158 +0x570
github.com/spf13/cobra.(*Command).execute(0x1400020ef08, {0x1400003e320, 0x5, 0x5})
	/Users/nikolayvladimirov/go/pkg/mod/github.com/spf13/[email protected]/command.go:983 +0x840
github.com/spf13/cobra.(*Command).ExecuteC(0x1400020e008)
	/Users/nikolayvladimirov/go/pkg/mod/github.com/spf13/[email protected]/command.go:1115 +0x344
github.com/spf13/cobra.(*Command).Execute(...)
	/Users/nikolayvladimirov/go/pkg/mod/github.com/spf13/[email protected]/command.go:1039
github.com/spf13/cobra.(*Command).ExecuteContext(...)
	/Users/nikolayvladimirov/go/pkg/mod/github.com/spf13/[email protected]/command.go:1032
github.com/form3tech-oss/f1/v2/pkg/f1.(*F1).execute(0x14000039e50, {0x0, 0x0, 0x0})
	/Users/nikolayvladimirov/go/src/github.com/form3tech-oss/f1/pkg/f1/f1.go:106 +0x16c
github.com/form3tech-oss/f1/v2/pkg/f1.(*F1).Execute(0x14000039e50?)
	/Users/nikolayvladimirov/go/src/github.com/form3tech-oss/f1/pkg/f1/f1.go:123 +0x28
main.main()
	/Users/nikolayvladimirov/go/src/github.com/form3tech-oss/f1/benchcmd/main.go:9 +0x13c
```
@nvloff-f3 nvloff-f3 marked this pull request as ready for review May 2, 2024 07:45
@nvloff-f3 nvloff-f3 requested a review from a team as a code owner May 2, 2024 07:45
pkg/f1/f1_stage_test.go Outdated Show resolved Hide resolved
pkg/f1/f1_stage_test.go Outdated Show resolved Hide resolved
pkg/f1/f1_test.go Outdated Show resolved Hide resolved
pkg/f1/f1_test.go Outdated Show resolved Hide resolved
Co-Authored-By: Liam Shepherd <[email protected]>
@nvloff-f3 nvloff-f3 merged commit 46b504f into master May 3, 2024
6 checks passed
@nvloff-f3 nvloff-f3 deleted the nvloff-miss-scen branch May 3, 2024 03:46
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.

2 participants