Skip to content

Commit 5bbdabb

Browse files
committed
test/integration/goTest: log suspicious tests
I don't know why but Kokoro CI often gets stuck while running tests in this file. I think it's probably a red herring and the culprit is somewhere else (GitHub CI seems ok with this test). Let's log to find where Kokoro CI gets stuck. Change-Id: Ia35c8c5ea9e586d31a089800abde25e4069e9da1 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/358545 Trust: Hyang-Ah Hana Kim <[email protected]> Run-TryBot: Hyang-Ah Hana Kim <[email protected]> TryBot-Result: kokoro <[email protected]> Reviewed-by: Peter Weinberger <[email protected]>
1 parent 6d4d3bf commit 5bbdabb

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/integration/goTest.run.test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,13 @@ suite('Go Test Runner', () => {
7676
const tests = Array.from(testExplorer.resolver.allItems).filter((x) => GoTest.parseId(x.id).name);
7777
assert(tests, 'No tests found');
7878

79+
console.log(`running ${tests.length} tests`);
80+
7981
assert(
8082
await testExplorer.runner.run({ include: tests }, null, { kind: 'cpu' }),
8183
'Failed to execute `go test`'
8284
);
85+
console.log('verify we got expected calls');
8386
const calls = await stub.getCalls();
8487
assert.strictEqual(calls.length, tests.length, 'expected one call to goTest per test');
8588
calls.forEach((call, i) =>
@@ -114,6 +117,7 @@ suite('Go Test Runner', () => {
114117
});
115118

116119
test('discover and run', async () => {
120+
console.log('discover and run');
117121
// Locate TestMain and TestOther
118122
const tests = testExplorer.resolver.find(uri).filter((x) => GoTest.parseId(x.id).kind === 'test');
119123
tests.sort((a, b) => a.label.localeCompare(b.label));
@@ -124,33 +128,40 @@ suite('Go Test Runner', () => {
124128
const [tMain, tOther] = tests;
125129

126130
// Run TestMain
131+
console.log('Run TestMain');
127132
assert(await testExplorer.runner.run({ include: [tMain] }), 'Failed to execute `go test`');
128133
assert.strictEqual(spy.callCount, 1, 'expected one call to goTest');
129134

130135
// Verify TestMain was run
136+
console.log('Verify TestMain was run');
131137
let call = spy.lastCall.args[0];
132138
assert.strictEqual(call.dir, subTestDir);
133139
assert.deepStrictEqual(call.functions, ['TestMain']);
134140
spy.resetHistory();
135141

136142
// Locate subtest
143+
console.log('Locate subtest');
137144
const tSub = tMain.children.get(GoTest.id(uri, 'test', 'TestMain/Sub'));
138145
assert(tSub, 'Subtest was not created');
139146

140147
// Run subtest by itself
148+
console.log('Run subtest by itself');
141149
assert(await testExplorer.runner.run({ include: [tSub] }), 'Failed to execute `go test`');
142150
assert.strictEqual(spy.callCount, 1, 'expected one call to goTest');
143151

144152
// Verify TestMain/Sub was run
153+
console.log('Verify TestMain/Sub was run');
145154
call = spy.lastCall.args[0];
146155
assert.strictEqual(call.dir, subTestDir);
147156
assert.deepStrictEqual(call.functions, ['TestMain/Sub']);
148157
spy.resetHistory();
149158

150159
// Ensure the subtest hasn't been disposed
160+
console.log('Ensure the subtest has not been disposed');
151161
assert(tSub.parent, 'Subtest was disposed');
152162

153163
// Attempt to run subtest and other test - should not work
164+
console.log('Attempt to run subtest and other test');
154165
assert(await testExplorer.runner.run({ include: [tSub, tOther] }), 'Failed to execute `go test`');
155166
assert.strictEqual(spy.callCount, 0, 'expected no calls to goTest');
156167
});

0 commit comments

Comments
 (0)