ci: rid test sync
This commit is contained in:
parent
ba9378fa29
commit
b53cbda642
|
@ -31,9 +31,11 @@ public class RIdGeneratorTests {
|
|||
executorService.submit(() -> {
|
||||
long nextId = NumGenerator.nextNum(projectId, ApplicationNumScope.API_DEFINITION);
|
||||
System.out.println(nextId);
|
||||
synchronized (projectId) {
|
||||
if (atomicLong.get() < nextId) {
|
||||
atomicLong.set(nextId);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
executorService.close();
|
||||
|
@ -58,9 +60,11 @@ public class RIdGeneratorTests {
|
|||
// 接口用例的前缀为: PROJECT_ID_API_DEFINITION 比较特殊
|
||||
long nextId = NumGenerator.nextNum(projectId + "_" + apiNum, ApplicationNumScope.API_TEST_CASE);
|
||||
System.out.println(nextId);
|
||||
synchronized (projectId) {
|
||||
if (atomicLong.get() < nextId) {
|
||||
atomicLong.set(nextId);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
executorService.close();
|
||||
|
|
Loading…
Reference in New Issue