Skip to content

Commit 8c7348d

Browse files
committed
[python_basic_gevent] collapse per-greenlet assertions into one regex-labeled assertion
The previous file had ten near-identical assertions, one per Greenlet-N task name, each expecting ~1.0e9 ns of wall-time. CI on Python 3.12 showed the per-greenlet task-name assignment is not deterministic across runs — one run had every greenlet at ~0.93e9 (all pass), the next had Greenlet-0 at 1.8e9 (absorbed Greenlet-1's samples) and Greenlet-1 at 0 (two assertion failures). Total wall-time was conserved either way. Pinning ten separate assertions to specific Greenlet-N IDs makes this scenario brittle against task-naming order that the profiler doesn't guarantee. Collapse them to one assertion using `values_regex` that matches any `Greenlet-N` task name and sums to ~10 s of wall-time (10 workers × 1 s each), which is the actual invariant the test cares about.
1 parent beb15cf commit 8c7348d

1 file changed

Lines changed: 3 additions & 186 deletions

File tree

scenarios/python_basic_gevent/expected_profile.json

Lines changed: 3 additions & 186 deletions
Original file line numberDiff line numberDiff line change
@@ -29,199 +29,16 @@
2929
"stack-content": [
3030
{
3131
"regular_expression": ".*target.*",
32-
"value": 1000000000,
32+
"value": 10000000000,
3333
"error_margin": 25,
3434
"labels": [
3535
{
3636
"key": "task name",
37-
"values": [
38-
"Greenlet-0"
39-
],
40-
"values_regex": ""
41-
}
42-
]
43-
}
44-
]
45-
},
46-
{
47-
"profile-type": "wall-time",
48-
"pprof-regex": "",
49-
"stack-content": [
50-
{
51-
"regular_expression": ".*target.*",
52-
"value": 1000000000,
53-
"error_margin": 25,
54-
"labels": [
55-
{
56-
"key": "task name",
57-
"values": [
58-
"Greenlet-1"
59-
],
60-
"values_regex": ""
61-
}
62-
]
63-
}
64-
]
65-
},
66-
{
67-
"profile-type": "wall-time",
68-
"pprof-regex": "",
69-
"stack-content": [
70-
{
71-
"regular_expression": ".*target.*",
72-
"value": 1000000000,
73-
"error_margin": 25,
74-
"labels": [
75-
{
76-
"key": "task name",
77-
"values": [
78-
"Greenlet-2"
79-
],
80-
"values_regex": ""
81-
}
82-
]
83-
}
84-
]
85-
},
86-
{
87-
"profile-type": "wall-time",
88-
"pprof-regex": "",
89-
"stack-content": [
90-
{
91-
"regular_expression": ".*target.*",
92-
"value": 1000000000,
93-
"error_margin": 25,
94-
"labels": [
95-
{
96-
"key": "task name",
97-
"values": [
98-
"Greenlet-3"
99-
],
100-
"values_regex": ""
101-
}
102-
]
103-
}
104-
]
105-
},
106-
{
107-
"profile-type": "wall-time",
108-
"pprof-regex": "",
109-
"stack-content": [
110-
{
111-
"regular_expression": ".*target.*",
112-
"value": 1000000000,
113-
"error_margin": 25,
114-
"labels": [
115-
{
116-
"key": "task name",
117-
"values": [
118-
"Greenlet-4"
119-
],
120-
"values_regex": ""
121-
}
122-
]
123-
}
124-
]
125-
},
126-
{
127-
"profile-type": "wall-time",
128-
"pprof-regex": "",
129-
"stack-content": [
130-
{
131-
"regular_expression": ".*target.*",
132-
"value": 1000000000,
133-
"error_margin": 25,
134-
"labels": [
135-
{
136-
"key": "task name",
137-
"values": [
138-
"Greenlet-5"
139-
],
140-
"values_regex": ""
141-
}
142-
]
143-
}
144-
]
145-
},
146-
{
147-
"profile-type": "wall-time",
148-
"pprof-regex": "",
149-
"stack-content": [
150-
{
151-
"regular_expression": ".*target.*",
152-
"value": 1000000000,
153-
"error_margin": 25,
154-
"labels": [
155-
{
156-
"key": "task name",
157-
"values": [
158-
"Greenlet-6"
159-
],
160-
"values_regex": ""
161-
}
162-
]
163-
}
164-
]
165-
},
166-
{
167-
"profile-type": "wall-time",
168-
"pprof-regex": "",
169-
"stack-content": [
170-
{
171-
"regular_expression": ".*target.*",
172-
"value": 1000000000,
173-
"error_margin": 25,
174-
"labels": [
175-
{
176-
"key": "task name",
177-
"values": [
178-
"Greenlet-7"
179-
],
180-
"values_regex": ""
181-
}
182-
]
183-
}
184-
]
185-
},
186-
{
187-
"profile-type": "wall-time",
188-
"pprof-regex": "",
189-
"stack-content": [
190-
{
191-
"regular_expression": ".*target.*",
192-
"value": 1000000000,
193-
"error_margin": 25,
194-
"labels": [
195-
{
196-
"key": "task name",
197-
"values": [
198-
"Greenlet-8"
199-
],
200-
"values_regex": ""
201-
}
202-
]
203-
}
204-
]
205-
},
206-
{
207-
"profile-type": "wall-time",
208-
"pprof-regex": "",
209-
"stack-content": [
210-
{
211-
"regular_expression": ".*target.*",
212-
"value": 1000000000,
213-
"error_margin": 25,
214-
"labels": [
215-
{
216-
"key": "task name",
217-
"values": [
218-
"Greenlet-9"
219-
],
220-
"values_regex": ""
37+
"values_regex": "^Greenlet-[0-9]+$"
22138
}
22239
]
22340
}
22441
]
22542
}
22643
]
227-
}
44+
}

0 commit comments

Comments
 (0)