Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WARNING] Failed to load requirements: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON #2955

Closed
xiannicolae opened this issue Oct 24, 2022 · 5 comments

Comments

@xiannicolae
Copy link

Sometimes, I noticed a lot of warning like the following, after all tests run are completed.
It is reproducible with the Serenity version 3.3.4+. The version I upgraded from, 3.1.5, was working fine.

[WARNING] Failed to load requirements: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 10563282 path $
com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 10563282 path $
	at com.google.gson.Gson.assertFullConsumption(Gson.java:967)
	at com.google.gson.Gson.fromJson(Gson.java:957)
	at net.thucydides.core.requirements.FileSystemRequirementsStore.read(FileSystemRequirementsStore.java:42)
	at net.thucydides.core.requirements.PackageRequirementsTagProvider.reloadedRequirements(PackageRequirementsTagProvider.java:115)
	at net.thucydides.core.requirements.PackageRequirementsTagProvider.fetchRequirements(PackageRequirementsTagProvider.java:110)
	at net.thucydides.core.requirements.PackageRequirementsTagProvider.getRequirements(PackageRequirementsTagProvider.java:94)
	at net.thucydides.core.requirements.RequirementsProvided.by(RequirementsProvided.java:17)
	at net.thucydides.core.requirements.MultiSourceRequirementsService.getRequirements(MultiSourceRequirementsService.java:40)
	at net.thucydides.core.requirements.BaseRequirementsService.getRequirementTypes(BaseRequirementsService.java:183)
	at net.thucydides.core.reports.html.FreemarkerContext.<init>(FreemarkerContext.java:81)
	at net.thucydides.core.reports.html.FreemarkerContext.<init>(FreemarkerContext.java:104)
	at net.thucydides.core.reports.html.HtmlAggregateStoryReporter.generateReportsForTestResultsIn(HtmlAggregateStoryReporter.java:152)
	at net.thucydides.core.reports.html.HtmlAggregateStoryReporter.generateReportsForTestResultsFrom(HtmlAggregateStoryReporter.java:134)
	at net.serenitybdd.maven.plugins.SerenityAggregatorMojo.generateHtmlStoryReports(SerenityAggregatorMojo.java:253)
	at net.serenitybdd.maven.plugins.SerenityAggregatorMojo.execute(SerenityAggregatorMojo.java:196)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
	at org.jvnet.hudson.maven3.launcher.Maven32Launcher.main(Maven32Launcher.java:132)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
	at jenkins.maven3.agent.Maven32Main.launch(Maven32Main.java:188)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at hudson.maven.Maven3Builder.call(Maven3Builder.java:139)
	at hudson.maven.Maven3Builder.call(Maven3Builder.java:70)
	at hudson.remoting.UserRequest.perform(UserRequest.java:211)
	at hudson.remoting.UserRequest.perform(UserRequest.java:54)
	at hudson.remoting.Request$2.run(Request.java:375)
	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:73)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 10563282 path $
	at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1597)
	at com.google.gson.stream.JsonReader.checkLenient(JsonReader.java:1404)
	at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:542)
	at com.google.gson.stream.JsonReader.peek(JsonReader.java:425)
	at com.google.gson.Gson.assertFullConsumption(Gson.java:963)
	... 46 more
@wakaleo
Copy link
Member

wakaleo commented Oct 24, 2022

The underlying question would be: why is the JSON malformed in the first place? Can you provide the JSON output that causes the issue?

@xiannicolae
Copy link
Author

@wakaleo I have no clue what JSON could be, because the executed tests had nothing to do with any JSON object.
I checked the serenity report output directory (where the index.html is generated) and for this particular suite, I found 7 json files.

I validated each of them and no issues were found.

However, I noticed that the overall execution time for the tests (including the serenity report creation) considerably increased for the serenity 3.3.5 - webdriver 4.5.1 pair: a simple test execution with maven, increased from 2:21 mins to 4:40 mins.

I am not sure if it is because of the webdriver or not.

Since there is no huge added value to use the latest versions, I switched back to serenity 3.1.16 and webdriver 4.1.3 where I have the fastest test execution.

@wakaleo
Copy link
Member

wakaleo commented Oct 24, 2022

Can you post the json files here?

@xiannicolae
Copy link
Author

@wakaleo unfortunately I cannot since contain sensitive data of the project.

In the end, I reverted the changes to the original versions of serenity and webdriver, but will keep an eye on the new versions.

@wakaleo
Copy link
Member

wakaleo commented Oct 26, 2022

In that case I will close this issue - please feel free to reopen if you can provide a sample project that reproduces the issue.

@wakaleo wakaleo closed this as completed Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants