Skip to content
This repository has been archived by the owner on Oct 2, 2021. It is now read-only.

Fix not hitting BPs on the first line of NTVS unit tests #369

Merged
merged 1 commit into from
Oct 16, 2018

Conversation

digeff
Copy link
Contributor

@digeff digeff commented Oct 16, 2018

We were comparing canonicalize vs normal case, so it wasn't matching and we didn't stop on 1,1 because we didn't realize there was a breakpoint there

@roblourens
Copy link
Member

What is this unit test testing? Why is it broken now and not before? Details...

@roblourens
Copy link
Member

CI?

@digeff digeff force-pushed the fix_unit_test_first_line branch from f7bd0ad to 7b29c72 Compare October 16, 2018 20:45
@digeff
Copy link
Contributor Author

digeff commented Oct 16, 2018

We have a non-deterministic test. I re-run them and they passed:
2018-10-16T19:33:46.8785757Z 1) ChromeDebugAdapter
2018-10-16T19:33:46.8785830Z Debugger.scriptParsed
2018-10-16T19:33:46.8785898Z tests that sendLoadedSourceEvent will set the reason parameter based on our internal view of the events we sent to the client:
2018-10-16T19:33:46.8785977Z
2018-10-16T19:33:46.8786036Z AssertionError [ERR_ASSERTION]: 'changed' == 'new'
2018-10-16T19:33:46.8786095Z + expected - actual
2018-10-16T19:33:46.8786166Z
2018-10-16T19:33:46.8786250Z -changed
2018-10-16T19:33:46.8786421Z +new
2018-10-16T19:33:46.8786474Z
2018-10-16T19:33:46.8786610Z at sendEventHandler (out\test\chrome\chromeDebugAdapter.test.js:500:32)
2018-10-16T19:33:46.8786684Z at Object.sendEvent (out\test\chrome\chromeDebugAdapter.test.js:93:25)
2018-10-16T19:33:46.8786795Z at ChromeDebugAdapter. (out\src\chrome\chromeDebugAdapter.js:759:27)
2018-10-16T19:33:46.8786922Z at Generator.next ()
2018-10-16T19:33:46.8787017Z at fulfilled (out\src\chrome\chromeDebugAdapter.js:7:58)
2018-10-16T19:33:46.8787094Z at

@roblourens
Copy link
Member

I still don't understand what's going on exactly, why is this just an issue now, what changed?

@roblourens
Copy link
Member

Is it related to the previous PR? Something else? Just include all the details, people in the future trying to understand why changes happened will thank you.

@digeff
Copy link
Contributor Author

digeff commented Oct 16, 2018

NTVS unit tests use an "attach" command. We enabled break-on-load there to avoid some race conditions that we had because we cleared all the breakpoints and re-added them.

This bug happens when you put a breakpoint on line 1 of a NTVS unit test. We are going to hit the break-on-load breakpoint and then we are going to see if there is an user breakpoint on line 1, to decide whether to resume or to pause and send this breakpoint to the client. That logic uses getScriptUrlFromId and it was not finding a user breakpoint when there was one, because the case wasn't matching.

This fixes that issue.

@roblourens
Copy link
Member

roblourens commented Oct 16, 2018

So it only breaks for "attach"? Or no bps on line 1 hit with break on load enabled?

I'll merge it to unblock you

@roblourens roblourens merged commit 489b59f into microsoft:master Oct 16, 2018
@digeff
Copy link
Contributor Author

digeff commented Oct 16, 2018

It only breaks with bps on line 1 with with break on load enabled.

@digeff digeff deleted the fix_unit_test_first_line branch October 16, 2018 22:47
@roblourens roblourens added this to the October 2018 milestone Nov 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants