Skip to content
This repository was archived by the owner on Apr 3, 2024. It is now read-only.

Commit 90be573

Browse files
Test success_on_timeout behavior (#217)
PR-URL: #217
1 parent b5c2910 commit 90be573

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

system-test/test-controller.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,36 @@ describe('Controller', function() {
7171
});
7272
});
7373

74+
it('should pass success on timeout', function(done) {
75+
this.timeout(100000);
76+
var controller = new Controller(debug);
77+
var debuggee =
78+
new Debuggee({
79+
project: process.env.GCLOUD_PROJECT,
80+
uniquifier: 'test-uid-' + Date.now(),
81+
description: 'this is a system test'
82+
});
83+
controller.register(debuggee, function(err, body) {
84+
assert.ifError(err, 'should be able to register successfully');
85+
86+
// First list should set the wait token
87+
controller.listBreakpoints(debuggee, function(err, response, body) {
88+
assert.ifError(err, 'should successfully list breakpoints');
89+
assert.ok(body);
90+
assert.ok(body.nextWaitToken);
91+
// Second list should block until the wait timeout
92+
controller.listBreakpoints(debuggee, function(err, response, body) {
93+
assert.ifError(err, 'should successfully list breakpoints');
94+
assert.ok(body);
95+
assert.ok(body.nextWaitToken);
96+
// waitExpired will only be set if successOnTimeout was given correctly
97+
assert.ok(body.waitExpired);
98+
done();
99+
});
100+
});
101+
});
102+
});
103+
74104
// To be able to write the following test we need a service for adding a
75105
// breakpoint (need the debugger API). TODO.
76106
it('should update an active breakpoint');

0 commit comments

Comments
 (0)