Skip to content
This repository was archived by the owner on Aug 17, 2020. It is now read-only.

Conversation

@tonyredondo
Copy link
Contributor

Fix support for import autoinstrument and TestMain scopeagent.Run call in the same package without creating agents and patching twice.

The import auto instrumentation patch the m.Run method to call scopeagent.Run, then if we call scopeagent.Run in the TestMain manually, will call this patched version of m.Run resulting in calling scopeagent.Run twice, and patching and creating two agents.

By setting a flag we can avoid the recursive call.

@tonyredondo tonyredondo requested a review from fermayo February 6, 2020 23:10
@tonyredondo tonyredondo self-assigned this Feb 6, 2020
@tonyredondo tonyredondo force-pushed the run-method-fix branch 2 times, most recently from c950a9a to 5aa3d43 Compare February 12, 2020 13:11
@tonyredondo tonyredondo force-pushed the run-method-fix branch 3 times, most recently from 267f4db to 2c1cdff Compare February 20, 2020 09:23
@tonyredondo tonyredondo merged commit 8487949 into master Feb 21, 2020
@tonyredondo tonyredondo deleted the run-method-fix branch February 21, 2020 14:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants