-
Notifications
You must be signed in to change notification settings - Fork 15
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
test: fix flaking e2e test (DRAFT) #901
Conversation
… reporting in the event of a test failure
Problem identified, cause not yet clear. Log excerpt from this test run
|
…n though npt printed the port and (apparently) started the srv process; add the --verbose flag to see if anything pops from the npt process's log
…l it flakes so we can see logs
… its log file and abandon the test run
By wrapping the srv in a shell script and having the client execute that shell script instead of the srv binary, I have determined that there is indeed an unhandled exception somewhere (because the exit code is 255). What I don't understand yet is why the runZonedGuarded error handler does not appear to be handling that exception For reference, the shell script
|
…ector so that the Srv can control what happens with any log messages that SocketConnector emits
…rr when spawned by a parent which has exited - Have bin/srv.dart set a LoggingHandler which will write to both a temporary file and stderr while the parent should still be alive but will only write to the temporary file once the parent can be expected to have exited. - The temporary file is placed in the platform-appropriate place (/tmp on unix, %TEMP% on Windows) - The temporary file is removed by the srv process itself if it exits normally, but is not removed if it exits abnormally. This is to enable diagnosis if problems occur. Yes, this is all a bit annoying.
I've finally got a smoking gun after making some substantial changes to how the logging works in the srv process. The core problem is that the parent process (sshnp or npt) reads what it needs from the child process's stderr and then exits but somehow, sometimes, this happens before the child process has finished using stderr.
srv_impl.dart line 421 is : |
- in SrvImplExec, add a grace period of 100 milliseconds after detecting what the child process has written to its stderr - in SrvImplDart, catch any exception thrown by stderr.writeln
…etries). atServers need to get more reliable
…t daemon logs for this test
await rvPortBound.future.timeout(Duration(seconds: 2)); | ||
await rvPortBound.future.timeout(Duration(seconds: 3)); | ||
|
||
await Future.delayed(Duration(milliseconds: 100)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A short grace period which should mean that the child process doesn't encounter an exception from stderr.writeln
' to stderr: ${e.toString()} ;' | ||
' stackTrace follows:\n' | ||
'$st'); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the child process does encounter an exception from stderr.writeln, then catch it, log it, but continue to execute
- What I did
- How I did it
- How to verify it