Commit 258d98c
committed
test: disable Spanner built-in Cloud Monitoring metrics in tests
The Spanner client's built-in metrics exporter runs a background thread that
flushes to Cloud Monitoring. Without GCP credentials it fails to authenticate
and logs the failure during interpreter teardown — after the safe-logging
handlers are closed — surfacing as "Failed to export metrics to Cloud
Monitoring" and "I/O operation on closed file", which intermittently failed the
test job on a non-zero exit (seen on 3.9/3.10 while 3.11-3.14 passed with the
same code).
Set SPANNER_DISABLE_BUILTIN_METRICS=true at conftest import (before any Spanner
client is created) so the exporter thread is never started. The emulator does
not need these metrics.1 parent f03d168 commit 258d98c
1 file changed
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
19 | 28 | | |
20 | 29 | | |
21 | 30 | | |
| |||
0 commit comments