Repository navigation
fix(e2e): wait for clean gates before admission rounds - #15
Conversation
|
Mateo Rossi · reviewer
|
|
Noah Williams · author It is the same comparison the lane uses to draw the turnstile ( 通道绘制转闸时用的就是同样的比较( |
|
Ben Carter · reviewer The table says the race showed on try 51. Will that number hold? 表格里写竞态出现在第 51 次尝试。这个数字会一直不变吗? |
|
Noah Williams · author No, it varies from run to run; the table records this capture. The spec allows up to 200 tries and fails if no try admits at both gates. 不会,每次运行都不一样,表格记的是这一次截图的情况。用例最多允许 200 次尝试,如果没有一次两台都放行,就会失败。 |
Why
The double-admission rounds started while lights and turnstiles from the previous round could still be active, so a round could be judged on leftover state, and the screenshot could catch the gates after they had already reset.
What changed
e2e/real-double-admission.spec.ts: before every round, wait up to 10 seconds until all four gates have their light off and their turnstile locked. Before the before-fix screenshot, wait until Gate 1 and Gate 2 are both green and open; before the fixed screenshot, wait until one is green and open and the other red and locked. Raise the test timeout to 12 minutes for the 200-try worst case.scripts/screenshots.sh:SCREENSHOT_PAIRS=double-admissioncaptures only the two double-admission pairs and needs only their two refs; the defaultallstill requires every ref.How to verify
With Docker and a Gatepost checkout:
The script ends with
double-admission screenshot pairs captured; no gatepost-sim-devices containers remain.背景
双闸机放行的每一轮在开始时,上一轮的指示灯和转闸可能还没复位,于是某一轮可能是按残留状态判定的;截图也可能拍到闸机已经复位之后的画面。
改动
e2e/real-double-admission.spec.ts:每轮开始前最多等待 10 秒,直到四台闸机的灯全部熄灭、转闸全部锁定。拍修复前截图之前,等 Gate 1 和 Gate 2 都亮绿灯且转闸打开;拍修复后截图之前,等一台绿灯打开、另一台红灯锁定。为应对最多 200 次尝试的情况,测试超时提高到 12 分钟。scripts/screenshots.sh:设置SCREENSHOT_PAIRS=double-admission时只拍两对双闸机截图,也只需要这两个版本变量;默认的all仍要求设置全部版本。怎么验证
安装 Docker 并准备 Gatepost 检出:
脚本最后输出
double-admission screenshot pairs captured; no gatepost-sim-devices containers remain.