spockframework / spockframework/spock

"IllegalArgumentException: ServletContext must not be null" when running integration tests in batch, but not individually

Open
#481 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Module-Core Type-Defect
Dominant language
Java
Stars
3.6k
Forks
483
PR merge metrics
No merged PRs in 30d

Description

Originally reported on Google Code with ID 359

What steps will reproduce the problem? If possible, provide source code and
stack trace.

1. see https://groups.google.com/forum/#!topic/spockframework/RvVh8RA_tok
2. happens when there is a mix of junit and spock integration tests.
3. if a junit test is run before the spock test in the batch of tests run, the error
"IllegalArgumentException: ServletContext must not be null" is thrown by all spock
tests.

What version of Spock and Groovy are you using?

grails: 2.3.5
groovy: 2.2.2
spock: built-in to grails

Reported by greg.houston@greatparentsacademy.com on 2014-04-09 01:37:26

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked Google Groups report and reproduce the sequence using Grails 2.3.5, Groovy 2.2.2, and the built-in Spock integration tests. Run a JUnit integration test before a Spock test in a batch, then compare that with individual runs; done means the batch no longer throws the ServletContext exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy, java
Domain
testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.