Commit 27818de
committed
NCBC-4207: Speed up Stellar unit tests with fast-fail timeouts
Motivation
==========
Couchbase.UnitTests wall-clock had grown to ~98s, dominated by
Stellar tests that point at an unreachable host ("couchbase2://xxx")
and rely on default per-service timeouts to fail. A single QueryAsync
test alone took 75s (default QueryTimeout), and the Test_Schema
theory took 6-12s per case waiting on DNS SRV resolution during
classic bootstrap.
Modification
============
- Added FastFailClusterOptions.WithFastFailTimeouts(FastFailServices),
a fluent extension on ClusterOptions that applies a short
KvConnectTimeout plus only the per-service timeouts the caller
exercises, with an optional DisableDnsSrv flag.
- Wired it into ClusterTests (Query|Analytics for CreateCluster;
DisableDnsSrv for Test_Schema_Delivers_The_Correct_ICluster_Impl)
and CollectionTests (Kv for CreateCollection).
Result
======
Unit test wall-clock drops from ~98s to ~9s on net8.0. Tests still
exercise the same failure paths.
Change-Id: I2a934064338348c59c684b3a2a8756c74fbabbde
Reviewed-on: https://review.couchbase.org/c/couchbase-net-client/+/245844
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Jeffry Morris <jeffrymorris@gmail.com>1 parent f5104af commit 27818de
3 files changed
Lines changed: 51 additions & 3 deletions
File tree
- tests/Couchbase.UnitTests
- Stellar
- KeyValue
- Utils
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
109 | 110 | | |
110 | 111 | | |
111 | 112 | | |
112 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
113 | 116 | | |
114 | 117 | | |
115 | 118 | | |
| |||
121 | 124 | | |
122 | 125 | | |
123 | 126 | | |
124 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
125 | 130 | | |
126 | 131 | | |
127 | 132 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
154 | 155 | | |
155 | 156 | | |
156 | 157 | | |
157 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
158 | 161 | | |
159 | 162 | | |
160 | 163 | | |
| |||
Lines changed: 40 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
0 commit comments