灌水 有没有人遇到过 pytest 用例太多,导致 allure 内存溢出的错误

红客联盟 · August 09, 2019 · Last by 红客联盟 replied at August 09, 2019 · 1298 hits

如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
共收到 7 条回复 时间 点赞

('', 'Exception in thread "main" java.lang.OutOfMemoryError: Java heap space\n\tat java.lang.AbstractStringBuilder.(Unknown Source)\n\tat java.lang.StringBuilder.(Unknown Source)\n\tat com.fasterxml.jackson.core.util.TextBuffer.contentsAsString(TextBuffer.java:394)\n\tat com.fasterxml.jackson.core.json.UTF8StreamJsonParser._finishAndReturnString(UTF8StreamJsonParser.java:2414)\n\tat com.fasterxml.jackson.core.json.UTF8StreamJsonParser.getText(UTF8StreamJsonParser.java:269)\n\tat com.fasterxml.jackson.databind.deser.std.StringDeserializer.deserialize(StringDeserializer.java:35)\n\tat com.fasterxml.jackson.databind.deser.std.StringDeserializer.deserialize(StringDeserializer.java:10)\n\tat com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:127)\n\tat com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288)\n\tat com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151)\n\tat com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:286)\n\tat com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:245)\n\tat com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:27)\n\tat com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:127)\n\tat com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288)\n\tat com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151)\n\tat com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:286)\n\tat com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:245)\n\tat com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:27)\n\tat com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:127)\n\tat com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288)\n\tat com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151)\n\tat com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4013)\n\tat com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3070)\n\tat io.qameta.allure.allure2.Allure2Plugin.readTestResult(Allure2Plugin.java:344)\n\tat io.qameta.allure.allure2.Allure2Plugin$$Lambda$70/1060097.apply(Unknown Source)\n\tat java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)\n\tat java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source)\n\tat java.util.stream.AbstractPipeline.copyInto(Unknown Source)\n\tat java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)\n\tat java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source)\n\tat java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source)\n')

RF开发的文件太大 挂了的就有

你的用例有多少啊?
1、这个是allure解析日志数据的时候内存满了,你先把测试结果文件拿出来看一下,可能是日志里面有很多stacktrace的log,导致文件过大;分析下用例写的是否有问题。
2、然后再把Xmx调大一点。

arrow 回复

写了80个,程序自己排列组合3000条,allure的Xmx在哪里调啊,我知道是这个问题,但是找不到位置

生成的pytest结果文件也就568M

守望@天空~ 回复

大佬,这里我改了,没用,问开发是单个文件都读到string里边的原因,单个文件大约有18M

需要 Sign In 后方可回复, 如果你还没有账号请点击这里 Sign Up