Commit message:
gopls/internal/test/integration: respect empty mode filter in runner
Fix a bug in the integration test runner where specifying Modes(0)
(an empty mode filter) was treated as "unset" due to a zero-value
check, causing the runner to fall back to default modes.
This CL fixes this by changing the runner's modes configuration to a
pointer, allowing us to distinguish between "unset" (nil) and
"explicitly empty" (0, NoMode).
This bug caused TestSimultaneousEdits to occasionally deadlock on
builders running with -short.
Under -short, DefaultModes() returns only Default mode (1), as defined
in regtest.go. TestSimultaneousEdits restricts its execution to
Modes(DefaultModes() & (Forwarded|SeparateProcess))
The intention was to run the test only in forwarded modes.
However, DefaultModes() = 1, Forwarded=2 and SeparateProcess=4,
so the resultng mode filter always evaluates to 0 (empty).
Due to the fallback bug, the runner saw 0 as "unset" and
incorrectly fell back to running the test in Default mode
(value 1) anyway, triggering a deadlock on the unbuffered net.Pipe
transport.
Also add a regression test in the misc package to ensure Modes(0) is
respected and does not fall back.
For golang/go#76713