@@ -73,12 +73,12 @@ public void sync_IfDelay_ThenNoBuffer() {
73
73
public void async_IfBotDelay_ThenClientBuffers () {
74
74
SynchronizationEnvironment environment = new SynchronizationEnvironment ();
75
75
environment .configuration
76
- .withAsync (true )
77
- .withMaxFrameDurationMs (10 )
78
- .withAsyncFrameBufferCapacity (4 );
76
+ .withAsync (true )
77
+ .withMaxFrameDurationMs (100 )
78
+ .withAsyncFrameBufferCapacity (4 );
79
79
80
80
environment .onFrame (1 , () -> {
81
- sleepUnchecked (50 );
81
+ sleepUnchecked (500 );
82
82
assertEquals ("Bot should be observing an old frame" , 1 , environment .bwClient .getGame ().getFrameCount ());
83
83
assertEquals ("Client should be as far ahead as the frame buffer allows" , 5 , environment .liveGameData ().getFrameCount ());
84
84
assertEquals ("Bot should be behind the live game" , 4 , environment .bwClient .framesBehind ());
@@ -97,20 +97,20 @@ public void async_IfBotDelay_ThenClientBuffers() {
97
97
public void async_IfBotDelay_ThenClientStalls () {
98
98
SynchronizationEnvironment environment = new SynchronizationEnvironment ();
99
99
environment .configuration
100
- .withAsync (true )
101
- .withMaxFrameDurationMs (50 )
102
- .withAsyncFrameBufferCapacity (5 );
100
+ .withAsync (true )
101
+ .withMaxFrameDurationMs (200 )
102
+ .withAsyncFrameBufferCapacity (5 );
103
103
104
104
environment .onFrame (1 , () -> {
105
- sleepUnchecked (125 );
105
+ sleepUnchecked (500 );
106
106
assertEquals ("3: Bot should be observing an old frame" , 1 , environment .bwClient .getGame ().getFrameCount ());
107
107
assertEquals ("3: Client should have progressed as slowly as possible" , 3 , environment .liveGameData ().getFrameCount ());
108
108
assertEquals ("3: Bot should be behind the live game by as little as possible" , 2 , environment .bwClient .framesBehind ());
109
- sleepUnchecked (50 );
109
+ sleepUnchecked (200 );
110
110
assertEquals ("4: Bot should be observing an old frame" , 1 , environment .bwClient .getGame ().getFrameCount ());
111
111
assertEquals ("4: Client should have progressed as slowly as possible" , 4 , environment .liveGameData ().getFrameCount ());
112
112
assertEquals ("4: Bot should be behind the live game by as little as possible" , 3 , environment .bwClient .framesBehind ());
113
- sleepUnchecked (50 );
113
+ sleepUnchecked (200 );
114
114
assertEquals ("5: Bot should be observing an old frame" , 1 , environment .bwClient .getGame ().getFrameCount ());
115
115
assertEquals ("5: Client should have progressed as slowly as possible" , 5 , environment .liveGameData ().getFrameCount ());
116
116
assertEquals ("5: Bot should be behind the live game by as little as possible" , 4 , environment .bwClient .framesBehind ());
@@ -211,7 +211,7 @@ public void async_MeasurePerformance_FrameBufferSizeAndFramesBehind() {
211
211
* Number of milliseconds of leeway to give in potentially noisy performance metrics.
212
212
* Increase if tests are flaky due to variance in execution speed.
213
213
*/
214
- private final static long MS_MARGIN = 10 ;
214
+ private final static long MS_MARGIN = 20 ;
215
215
216
216
@ Test
217
217
public void MeasurePerformance_BotResponse () {
0 commit comments