You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
testing: T.Setenv can be called after T.Parallel #55128
I'm not sure what is wrong with calling t.Setenv in a function passed to t.Run. It would be wrong if the function calls t.Parallel, but if it doesn't, it should work reliably. It may not do what you want, but it shouldn't be flaky. Do I misunderstand?
Activity
ianlancetaylor commentedon Sep 18, 2022
I'm not sure what is wrong with calling
t.Setenvin a function passed tot.Run. It would be wrong if the function callst.Parallel, but if it doesn't, it should work reliably. It may not do what you want, but it shouldn't be flaky. Do I misunderstand?ZekeLu commentedon Sep 18, 2022
I think noi@ means that a sub test is flaky when it calls
t.Setenvwhile its parent has calledt.Parallel. This looks plausible.ianlancetaylor commentedon Sep 18, 2022
Ah, yes, I see. We need to walk the
parentlist or something.noi commentedon Sep 18, 2022
Thank you for your replying!
I'm sorry for confusing you by my bad English. ZekeLu is right, I wanted to say like that.
I'm trying to fix this issue by passing
isAncestorParalellto sub test int.Run.gopherbot commentedon Sep 18, 2022
Change https://go.dev/cl/431101 mentions this issue:
testing: fix T.Setenv for not calling to it in parallel testsnoi commentedon Sep 18, 2022
I sent my changes, so I would appreciate it if you could review it when you have time🙇♂️
gopherbot commentedon Sep 25, 2022
Change https://go.dev/cl/434115 mentions this issue:
testing: update description of Setenvtesting: update description of Setenv
testing: fail if T.Setenv is called via T.Run in a parallel test