Understanding Ember-Cli Testing - ember.js

I am trying to get testing set up on an Ember-CLI project, but it currently crashes any browser it is ran in and seems to just freeze when ran from the command line.
From the command line the last line I see is;
ok 58 PhantomJS 1.9 - JSHint - routes: routes/projects.js should pass jshint
Which is alphabetically the last route file in the directory.
What I would like to know is what the test suite is likely going onto next so I can investigate what could be causing this freeze.
What I have tried
Googling and reading the associated files inside of /tests/, I couldn't see anything obviously out of whack.
Versions
In case it matters;
Ember-CLI - 0.0.42
PhantomJS - 1.9.7

In this case it was one of the next tests it was hitting (a test created by us) that was throwing an error that was seemingly getting caught somewhere and not displayed.
Rewriting the offending tests (they were written for an earlier version of Ember-CLI, which may have something to do with it) fixed the issue.

Related

Plugin build with C++/Juce - Crashed validation in LogicProX

I'm completely new to this but I'm taking a course in Audio Plugin Development as a way to try and improve my understanding of C++. I've hit a wall quite early where the plugin caused Logic to crash. I'm using Xcode and Juce and when I got to this point in Xcode and built the plugin, it said 'build succeeded' and opened Logic, which then crashed, directing me back to this line of code
thread 1: breakpoint1.1
If I open Logic independently without Xcode, it's not crashing, but when I reset and rescan plugins, I get a crashed validation for that plugin
Logic: crashed validation
I don't fully understand where it's directing me to or where the problem is, I retraced my steps in following the directions in the course and I think I've done everything correctly. In the previous step I did the initial build of the plugin and that worked fine, without any crashes.
I've tried deleting breakpoints and running again but it's still the same problem. As I say, I'm very new to this so could be something very simple but any help would be great. Thanks a lot

Chromium-browser build fatal errors in module_list.cc: Check Failed

I've been trying to build chromium on Windows 10, but I am getting weird errors on runtime, which appear to be caused by that pattern:
void CheckFreeLibrary(HMODULE module) {
BOOL result = ::FreeLibrary(module);
DCHECK(result);
}
The first errors are displayed after a few seconds after Chromium is started. Here's what it says:
[5904:9192:0726/025753:FATAL:module_list.cc(18)] Check failed: result.
Backtrace:
base:debug:StackTrace:StackTrace [0x0000....] (e:\projects\clones\chromium\src\base\debug\stack_trace.cc) ...
Since I couldn't copy paste the whole stack, I will join a screenshot of what it all feels like:
I am successful in building the last revision, or at least, it appears to be successful since no errors are showing up when compiling with the toolchain recommended in Building instructions.
Luckily, the first errors aren't modal and it is possible to browse a little bit afterwards. Then, if I put the application into heavy loading (such as Facebook newsfeed), it will suddently stop responding in a silent way. Mouse hovering effects will not show anymore and reloading the page will result in infinite loading. This behavior is also reproductible when right-clicking on some pages (e.g.: google's home page does it sometimes).
What could be an explanation of this not working "out of the box" with default configuration? How to fix this?
P.S.: This question is complementary to this question:
Windows chromium-browser fresh build stacktrace and anonymous fatal errors on runtime, if it can help getting the big picture of the question.
P.S.2.: I am currently trying to rebuild from start again with this slight change to see if it works out better. I will be able to see it after about 10 hours, though (yes, the build is painful on my current setup).
void CheckFreeLibrary(HMODULE module) {
BOOL result = ::FreeLibrary(module);
if (!result) {
result = ::UnmapViewOfFile(module);
}
DCHECK(result);
}
Update - 2016/07/29
Test with CheckFreeLibrary still failed in debug, but I finally found a way to resolve the issues in a build. See update 3 in superuser question. What I did was configuring the build into release mode via gn args. This is, obviously, almost impossible to debug with, so a solution / explanation is yet to be found about why it fails in debug mode. This is quite close now, though.
Update 2 - 2016/08/13
Started all over again to have a debug version again with the latest version in the repositories, and this time I was sure enough to find something. In fact, after I've run through the usual procedure to update, generate and build, I noticed that some win-core-* DLL libraries located in the Windows Kit debugger weren't copied src folder but one of those was assumed to be there during the link process. As a precaution, I've simply copied them all to be sure that any delay-load or build dependency was there. The first time chromium has launched, the errors didn't show up and thought it was resolving the issue. However, right-clicking on the Google Homepage had the same effect (no response, then browser not showing pages anymore). After closing and reopening it, errors are beginning to show up.
Is there anyone that had experienced that? I would be very happy with something like "do it on linux, it works better on this platform". I am not willing to do it without knowing it will work any better, though.
So
BOOL result = ::FreeLibrary(module);
fails in debug builds see if you have a
DWORD WINAPI GetLastError(void);
to get the real error.
I could guess
module not loaded
module is NULL
Perhaps some DEBUG statement is changing the value of module?

Testify is seemingly running test suites concurrrently?

Basically I created a new test file in a particular package with some bare bones test structure - no actual tests...just an empty struct type that embeds suite.Suite, and a function that takes in a *testing.T object and calls suite.Run() on said struct. This immediately caused all our other tests to start failing indeterministically.
The nature of the failures were associated with database unique key integrity violations on inserts and deletes into a single Postgres DB. This is leading me to believe that the tests were being run concurrently without calling our setup methods to prepare the environment properly between tests.
Needless to say, the moment I move this test file to another package, everything magically works!
Has anyone else run into this problem before and can possibly provide some insights?
What I've found from my use, is that "go test" runs a single package's test cases sequentially (unless t.Parallel() is called), but if you supply multiple packages (go test ./foo ./bar ./baz), each package's tests are run parallel to other packages. Definitely caused similar headaches with database testing for me.
As it turns out, this is a problem rooted in how go test works, and has nothing to do with testify. Our tests were being ran on ./... This causes the underlining go test tool to run tests in each package in parallel, as justinas pointed out. After digging around more on StackOverflow (here and here) and reading through testify's active issue on this problem, it seems that the best immediate solution is to use the -p=1 flag to limit the number of packages to be run in parallel.
However, it is still unexplained why the tests consistently passed prior to adding these new packages. A hunch is perhaps the packages/test files were sorted and ran in such a manner that concurrency wasn't an issue prior to adding the new packages/files.

XSocket Upgrade from 3.x to 4.0 - System.InvalidOperationException on GetExport

We have a server application that runs as a Console Application and it has all been working great with 3.x version of XSockets. We are currently upgrading to 4.0 to benefit from the improved binary messaging.
At the moment we have everything building with the new 4.0 assemblies but can't get the server to start and are getting the following;
System.InvalidOperationException - Sequence contains no matching element
When calling...
m_xserver = XSockets.Plugin.Framework.Composable.GetExport<IXSocketServerContainer>(); <--- Exception happening here.
m_xserver.Start();
foreach (var server in m_xserver.Servers)
{
LOG.DEBUG("XSocket Server {0}", server.ConfigurationSetting.Endpoint);
}
We have checked and double check the Nuget references and compared the files in the output directory. We do have the server code in a DLL that gets called from the EXE but it all worked before moving.
If I "Continue" on the exception I get a stack over flow error after a few seconds.
In a bid to discover what (if any) DLL or Class is causing the issue I put the above code it the beginning of Mani() and commented out everything else. The app still fails in the same way. However if I start to delete the now not required DLLs from the build folder (starts with 102 files of DLL/XML/PDB) then it will start to work when I get to around 21 to 25 DLL files left. This seems very strange as I've tried to vary the deleted files as best I can and a different combination will still allow it to work at around the same number of files!!
Is there a limit to the number of files the Plugin Framework can handle?
I took a deeper look at the files causing this by copying them one by one to a known working XSockets 4.0 Console App. It turns out that a mixture of my DLLs and third party DLLs somehow make the Plugin framework crash. These are..
A number of my own custom DLLs
GalaSoft.MvvmLight.Extras.WPF45.dll
MahApps.Metro.dll
Microsoft.AspNet.SignalR.Client.dll
Microsoft.AspNet.SiganlR.Core.dll
Microsoft.Owin.dll
Microsoft.Owin.Security.dll
RazorEngine.dll
System.Net.Http.Formatting.dll
System.Web.Http.dll
System.Web.Http.SelfHost.dll
System.Windows.Interactivity.dll
Even an unmanaged DLL from Truen TVSN.dll causes the stack overflow to happen.

Why does Run All cause a crash in VS2012 unit testing but running one by one doesn't?

We just "upgraded" from Visual Studio 2008 to Visual Studio 2012. We updated our unit tests and now they pass when running them individually but when I try to Run All, I got the following error:
The active Test Run was aborted because the execution process exited unexpectedly. To investigate further, enable local crash dumps either
at the machine level or for process vstest.executionengine.appcontainer.x86.exe. Go to more details: [http://go.microsoft.com/fwlink/?linkid=232477][1]
So I went to the link and followed the instructions to add the registry key to enable local crash dumps. The error message then changed to:
The active Test Run was aborted because the execution process exited unexpectedly. Check the execution process logs for more information.
If the logs are not enabled, then enable the logs and try again.
Apparently it noticed the changes that I made in the registry to enable crash. However, when I looked in %LOCALAPPDATA%\CrashDumps, no files were being created.
If I run one test at a time (or even a few tests at a time), I can get them all to pass. The problem is only with Run All.
Has anyone else encountered similar problems? If so, how did you solve them?
Essentially the same question was asked on MSDN, but the answer was something like "click the link to the crash dump". That answer doesn't help me because I don't see any link to the crash dump and I am unable to get the crash dump to be generated.
This question on StackOverflow is also similar, and ended up resulting in a bug being logged on Microsoft Connect (which looks to be deferred for some reason), but my problem might be different because my code has nothing to do with "async tasks" (I don't think).
EDIT: The problem went away, seemingly on its own, but the problem was likely an exception that wasn't being caught in the unit test code, as some of the answers below suggest. However, I'm still confused as to why the problem only appeared with Run All, and not when running smaller groups of tests or Debug All.
I had the same problem, the tests failed for apparently no reason. Later I found that a buggy method was causing a StackOverflowException. When I fixed my bug, the VS bug disappeared.
Maybe it works most of the time because you don't run the faulty code.
The best workaround I have so far is to debug all. This is done via TEST -> Debug -> All Tests. It's obviously slower but it doesn't crash.
This can happen with certain errors, such as a stackoverflow. Presumably this is crashing the test runner and so it can't continue when it hits a test that causes the problem.
The solution, therefore, is to run all tests in debug (from the Test -> Debug menu) and Visual Studio will show errors like these.
For anyone else who may need this in future: My test runner was crashing when a console specific command (Environment.Exit(-1);) was executed via the unit test. Even running in debug mode would just crash - I could not get at a useful error message.
So my scenario is different to the main question scenario in that a) debug didn't work at all b) run all vs run individually made no difference. That is because my error scenario always arose but the stack overflows of the original question did not.
The bottom line: test runner is bad and will crash if it finds something it doesn't like. You need to manually isolate and work out what the Bad Thing™ is.
For someone else looking for this: I had some code that was calling System.Environment.Exit(123), and I was unaware of this. So check for any code that terminates the process.
I've just had the same problem. It turned out that was my code - there was an infinite loop of WCF service calls. In your case this might be something else. So my proposal is to either remember (logs in version control system?) or to figure out (by excluding different tests from run, e.g. with bisection method) which place in code leads to this behavior. And wuala! It's cause of the problem and at the same time bug in code.
UPDATE
As for questions in your EDIT. It could happen that running smaller groups of tests didn't reproduce the issue. In this case, given those groups included all tests, one can make an assumption that some tests interfere. Maybe some static data or fields in a test class?
As for running tests in debug mode - I'm not surprised. Visual Studio test runner behaves different in "Run" mode vs "Debug" one.
I had a similar problem except that it wasn't a stackoverflow exception. It was caused by my project under test using Entity Framework and the NUnit project not having references included to the EntityFramework and EntityFramework.SqlServer modules. Adding the references to Entity Framework modules fixed it.
Just had the same problem. Closing and reopening visual studio fixed it for me.