Test: Make sure that max can't be lower than min (#34020)

This commit is contained in:
Zoltán Bedi 2021-05-12 21:14:30 +02:00 committed by GitHub
parent abdceb18da
commit 64f31a8d6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -141,6 +141,8 @@ export default chance.mixin({
max: traceEndTime,
});
const maxDuration = traceEndTime - startTime;
return {
traceID,
processID: chance.pickone(Object.keys(processes)),
@ -149,7 +151,7 @@ export default chance.mixin({
operationName: chance.pickone(operations),
references: [],
startTime,
duration: chance.integer({ min: 1, max: traceEndTime - startTime }),
duration: chance.integer({ min: 1, max: maxDuration <= 1 ? 2 : maxDuration }),
tags: chance.tags(),
logs: [],
};