Skip to content

Commit f2308db

Browse files
hritanTaneja Hridayjacob314
authored
test: fix flaky integration tests for compress command (google-gemini#10371)
Co-authored-by: Taneja Hriday <[email protected]> Co-authored-by: Jacob Richman <[email protected]>
1 parent c9eb58e commit f2308db

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

integration-tests/context-compress-interactive.test.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,6 @@ describe('Interactive Mode', () => {
9999
await new Promise((resolve) => setTimeout(resolve, 100));
100100
await type(ptyProcess, '\r');
101101

102-
const foundEvent = await rig.waitForTelemetryEvent(
103-
'chat_compression',
104-
90000,
105-
);
106-
expect(foundEvent).toBe(true);
107-
108102
const compressionFailed = await rig.waitForText(
109103
'compression was not beneficial',
110104
25000,

integration-tests/replace.test.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,14 @@ describe('replace', () => {
140140
it('should insert a multi-line block of text', async () => {
141141
const rig = new TestRig();
142142
await rig.setup('should insert a multi-line block of text');
143-
const fileName = 'insert_block.js';
144-
const originalContent = 'function hello() {\n // INSERT_CODE_HERE\n}';
145-
const newBlock = "console.log('hello');\n console.log('world');";
146-
const expectedContent = `function hello() {\n ${newBlock}\n}`;
143+
const fileName = 'insert_block.txt';
144+
const originalContent = 'Line A\n<INSERT_TEXT_HERE>\nLine C';
145+
const newBlock = 'First line\nSecond line\nThird line';
146+
const expectedContent =
147+
'Line A\nFirst line\nSecond line\nThird line\nLine C';
147148
rig.createFile(fileName, originalContent);
148149

149-
const prompt = `In ${fileName}, replace "// INSERT_CODE_HERE" with:\n${newBlock}`;
150+
const prompt = `In ${fileName}, replace "<INSERT_TEXT_HERE>" with:\n${newBlock}`;
150151
const result = await rig.run(prompt);
151152

152153
const foundToolCall = await rig.waitForToolCall('replace');

0 commit comments

Comments
 (0)