overture icon indicating copy to clipboard operation
overture copied to clipboard

Combinatorial testing: problems closing connections after execution

Open peterwvj opened this issue 8 years ago • 0 comments

Although it happens very rarely, Overture sometimes raises an "internal error" after CT generation. The error seems harmless though (all tests have been executed). The following stack trace is produced:

java.lang.ArrayStoreException: org.eclipse.core.internal.jobs.Worker
at java.lang.ThreadGroup.enumerate(Unknown Source)
at java.lang.ThreadGroup.enumerate(Unknown Source)
at org.overture.combinatorialtesting.vdmj.server.ConnectionListener.getConnections(ConnectionListener.java:156)
at org.overture.combinatorialtesting.vdmj.server.ConnectionListener.die(ConnectionListener.java:119)
at org.overture.ide.plugins.combinatorialtesting.internal.TraceTestEngine$1.run(TraceTestEngine.java:199)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

When traces are executed, the progress is communicated back to Overture via sockets. Closing the connections (line 199 in TraceTestEngine), seems to be what is going wrong. This problem occurs when Overture tries to collect the connections that must be closed:

public ConnectionThread[] getConnections()
{
  ConnectionThread[] all = null;

  do
  {
    all = new ConnectionThread[group.activeCount()];
  } while (group.enumerate(all) != all.length); // 156: Exception is thrown here

  return all;
}

According to the Java API an ArrayStoreException is "thrown to indicate that an attempt has been made to store the wrong type of object into an array of objects." We should definitely try to collect the connections in a safer way, and report a bit more detail in case problems occur.

peterwvj avatar Feb 27 '17 13:02 peterwvj