MCPcopy Create free account
hub / github.com/e2wugui/zeze / verify

Method verify

ZezeJava/ZezeJavaTest/src/Infinite/Tasks.java:204–250  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

202 }
203
204 @Override
205 void verify() throws Exception {
206 super.verify();
207
208 // verify 时,所有任务都执行完毕,不需要考虑并发。
209 var name = Table1Long2Add1.class.getName();
210 var app = Simulate.getInstance().randApp().app; // 任何一个app都能查到相同的结果。
211 var success = getSuccessCounter(name).sum();
212 var sum = 0L;
213 for (var it = getKeyCounters(name).keyIterator(); it.hasNext(); ) {
214 for (int tryCount = 10; ; ) {
215 try {
216 var key = it.next();
217 var v1 = app.demo_Module1.getTable1().selectDirty(key);
218 if (v1 == null)
219 Simulate.logger.warn("app.demo_Module1.getTable1().selectDirty({}) = null", key);
220 else {
221 var v = v1.getLong2();
222 sum += v;
223 if (debugTradeSum)
224 Simulate.logger.info("--- key:{} value:{}", key, v);
225 }
226 break;
227 } catch (GoBackZeze e) {
228 if (--tryCount <= 0)
229 throw e;
230 try {
231 //noinspection BusyWait
232 Thread.sleep(200);
233 } catch (InterruptedException ex) {
234 throw new RuntimeException(ex);
235 }
236 }
237 }
238 }
239 if (success != sum) {
240 var a = new OutLong();
241 app.demo_Module1.getTable1().walk((k, v) -> {
242 a.value += v.getLong2();
243 return true;
244 });
245 Simulate.logger.error("Table1Long2Add1 verify failed: {} != {} (walk:{}, commitCount:{})",
246 success, sum, a.value, commitCount.sum());
247 }
248 Assert.assertEquals(success, sum);
249 Simulate.logger.debug("{}.verify OK!", name);
250 }
251 }
252
253 static class Table1List9AddOrRemove extends Task {

Callers

nothing calls this directly

Calls 15

getInstanceMethod · 0.95
sumMethod · 0.80
getSuccessCounterMethod · 0.80
getKeyCountersMethod · 0.80
getTable1Method · 0.80
getLong2Method · 0.80
getNameMethod · 0.65
keyIteratorMethod · 0.65
hasNextMethod · 0.65
nextMethod · 0.65
selectDirtyMethod · 0.65
walkMethod · 0.65

Tested by

no test coverage detected