Commit 26edf50
committed
fixup single-step test
This commit is an attempt to fix the test failure here:
<http://buildbot2.highlab.com/buildbot/#/builders/11/builds/990/steps/13/logs/stdio>
I believe the test failure is due to a race condition in the test script,
not a bug in LinuxCNC.
Before this commit, the test requests a step any time the machine X
and Y positions are both very near an integer multiple of 5. The test
failure linked above shows this in the log:
Taking step from X30.00 Y30.00
line=9; Xpos=30.98; Ypos=30.00; Zpos=0.00; counter=25
line=9; Xpos=31.82; Ypos=30.00; Zpos=0.00; counter=25
line=9; Xpos=32.65; Ypos=30.00; Zpos=0.00; counter=25
line=9; Xpos=33.48; Ypos=30.00; Zpos=0.00; counter=25
line=9; Xpos=34.32; Ypos=30.00; Zpos=0.00; counter=25
task: main loop took 0.015550 seconds
Taking step from X35.00 Y30.00
line=9; Xpos=35.00; Ypos=30.00; Zpos=0.00; counter=25
Taking step from X35.00 Y30.00
line=0; Xpos=35.00; Ypos=30.00; Zpos=0.00; counter=25
Taking step from X35.00 Y30.00
line=9; Xpos=35.00; Ypos=30.00; Zpos=0.00; counter=25
Taking step from X35.00 Y30.00
line=5; Xpos=34.02; Ypos=30.00; Zpos=0.00; counter=0
line=5; Xpos=33.19; Ypos=30.00; Zpos=0.00; counter=0
...
End counter incorrect: 5 != 25
Normally the test would stop at (X=35, Y=30) with counter=25, and the
test would pass.
I believe in this case the test script got to run a couple of extra loops
while waiting for LinuxCNC (Task & Motion) to respond to the earlier
single-step requests, and thus queued up a bunch of extra single-step
requests, which restarted the G-code program being single-stepped.
The G-code program starts out by resetting the counter, so when the
test finished it saw the new counter from the (incorrect) next run of
the G-code program.
This commit changes the test program to avoid this race, by waiting for
each step to start and complete before considering issuing another step.1 parent 43b8dc8 commit 26edf50
1 file changed
Lines changed: 42 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
60 | 93 | | |
| 94 | + | |
61 | 95 | | |
62 | 96 | | |
63 | 97 | | |
64 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
65 | 103 | | |
66 | 104 | | |
67 | | - | |
| 105 | + | |
68 | 106 | | |
69 | 107 | | |
70 | | - | |
| 108 | + | |
71 | 109 | | |
72 | 110 | | |
73 | 111 | | |
74 | 112 | | |
75 | 113 | | |
76 | 114 | | |
77 | 115 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | 116 | | |
82 | 117 | | |
83 | 118 | | |
| |||
0 commit comments