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: Use fresh instance on each new plugin invocation #413

Merged
merged 3 commits into from
Apr 5, 2023

Conversation

ospencer
Copy link
Contributor

@ospencer ospencer commented Apr 5, 2023

Porting this fix from suborbital/sat#179

@ospencer ospencer requested review from callahad, javorszky and cohix April 5, 2023 14:28
@ospencer ospencer self-assigned this Apr 5, 2023
@callahad
Copy link

callahad commented Apr 5, 2023

@ospencer You're failing in CI:

--- FAIL: TestEngineFetch (0.27s)
panic: interface conversion: interface {} is *request.CoordinatedResponse, not []uint8 [recovered]
	panic: interface conversion: interface {} is *request.CoordinatedResponse, not []uint8

goroutine 31 [running]:
testing.tRunner.func1.2({0x13c9ce0, 0xc0012d0060})
	/opt/hostedtoolcache/go/1.20.2/x64/src/testing/testing.go:1526 +0x24e
testing.tRunner.func1()
	/opt/hostedtoolcache/go/1.20.2/x64/src/testing/testing.go:1529 +0x39f
panic({0x13c9ce0, 0xc0012d0060})
	/opt/hostedtoolcache/go/1.20.2/x64/src/runtime/panic.go:884 +0x213
github.com/suborbital/e2core/sat/engine2/enginetest.TestEngineFetch(0xc000170680)
	/home/runner/work/e2core/e2core/sat/engine2/enginetest/engine_test.go:159 +0x758
testing.tRunner(0xc000170680, 0x1450e80)
	/opt/hostedtoolcache/go/1.20.2/x64/src/testing/testing.go:[157](https://github.com/suborbital/e2core/actions/runs/4619606359/jobs/8168575352?pr=413#step:7:158)6 +0x10b
created by testing.(*T).Run
	/opt/hostedtoolcache/go/1.20.2/x64/src/testing/testing.go:[162](https://github.com/suborbital/e2core/actions/runs/4619606359/jobs/8168575352?pr=413#step:7:163)9 +0x3ea
FAIL	github.com/suborbital/e2core/sat/engine2/enginetest	0.484s

@callahad
Copy link

callahad commented Apr 5, 2023

@javorszky Any chance you can figure out the CI failure?

@callahad
Copy link

callahad commented Apr 5, 2023

Other recent PRs also show the same error, so this PR isn't the cause. We should review + merge independently of diagnosing that test failure.

@callahad
Copy link

callahad commented Apr 5, 2023

Tracking the CI failure in #414

@javorszky
Copy link
Contributor

javorszky commented Apr 5, 2023

the fun thing is that the same issue does not appear on my local when I run make test.

When running the one test function from inside goland, it does happen though. Weird.

Copy link
Contributor

@javorszky javorszky left a comment

Choose a reason for hiding this comment

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

Made two small changes on top of what the original PR was:

  • skipping a test that depends on external something outside of our control (1password error page)
  • passing in instance into deferred function and using a differently named variable inside the function to better separate scopes and guard against shadowing

@javorszky javorszky merged commit 2b957b1 into main Apr 5, 2023
@javorszky javorszky deleted the oscar/fresh-instance branch April 5, 2023 15:39
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.

3 participants