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

Breakpoint tests #66

Merged
merged 5 commits into from
Nov 29, 2016
Merged

Breakpoint tests #66

merged 5 commits into from
Nov 29, 2016

Conversation

ctrlpz
Copy link
Contributor

@ctrlpz ctrlpz commented Nov 28, 2016

This fixes #62.

Copy link
Owner

@smarr smarr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but a few things in the java code

public SResolver chainedPromise(final VirtualFrame frame,
final SResolver resolver, final SPromise result,
@Specialization(guards = {"resolver.getPromise() != resolvedValue"})
public SResolver chainedPromise(final VirtualFrame frame, final SResolver resolver, final SPromise resolvedValue,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolvedValue isn't a good name.
This is a promise, so even resolutionValue sounds strange and is unclear later in the code.

isBreakpointOnPromiseResolution);
} else if (result.isErroredUnsync()) {
synchronized (resolvedValue) {
if (resolvedValue.isResolvedUnsync()) { //resolved
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved what? also the code is pretty clear, it tests whether the 'value' is isResolved.
I still don't like the variable name for resolvedValue or resolutionValue. Would be good if this reads like a promise name.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about promiseValue?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, think that might be better

} else {
synchronized (promise) { // TODO: is this really deadlock free?
result.addChainedPromise(promise);
} else { //unresolved promise
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the test seems still pretty clear to me. I would avoid such trivial comments if possible.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, please see the comments around, there is always a space after the //

@@ -323,7 +325,8 @@ protected static void resolveChainedPromisesUnsync(final SPromise promise,
// TODO: restore 10000 as parameter in testAsyncDeeplyChainedResolution
if (promise.chainedPromise != null) {
Object wrapped = promise.chainedPromise.owner.wrapForUse(result, current, null);
resolveAndTriggerListenersUnsynced(result, wrapped, promise.chainedPromise, current, isBreakpointOnPromiseResolution);
// resolveAndTriggerListenersUnsynced(result, wrapped, promise.chainedPromise, current, isBreakpointOnPromiseResolution);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please don't leave commented code in the files

@@ -117,6 +117,7 @@ private Breakpoint saveTruffleBasedBreakpoints(final SectionBreakpoint bId) {
FullSourceCoordinate coord = bId.getCoordinate();
BreakpointEnabling<T> existingBP = breakpoints.get(coord);
if (existingBP == null) {
WebDebugger.log("SetSectionBreakpoint: " + bId);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't include debug output in commits.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in thesaveTruffleBasedBreakpoints method is also used this log, should I remove them both?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the other possibility would be to change .log() so that it is enabled or disabled via a switch in the ./som executable. but for the moment, it might be easier to just remove them.

- added test for resolver and resolution promise breakpoint
- changes in pingpong program to be able to set the breakpoints
- add test for promise resolver breakpoint in the case of null resolution
- add test for promise resolver breakpoint in the case of chained promises
- add test for promise resolution breakpoint in the case of chained promises
- fix promise breakpoint tests
  - fix line numbers and method names where promise resolver breakpoint is triggered
  - fix line number and method name where promise resolution breakpoint is triggered for chained resolution
Signed-off-by: Stefan Marr <git@stefan-marr.de>
- renamed and moved old getSectionBreakpointData to be located close to the createLineBreakpointData method

Signed-off-by: Stefan Marr <git@stefan-marr.de>
Signed-off-by: Stefan Marr <git@stefan-marr.de>
@smarr smarr merged commit 4114a39 into smarr:master Nov 29, 2016
@smarr smarr deleted the breakpoint-tests branch November 29, 2016 12:46
@smarr smarr added this to the v0.1.0 milestone Mar 6, 2017
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

Successfully merging this pull request may close these issues.

2 participants