<commit_before>require('./helpers').allTransactions("Streaming results", function (tx, test) {
	tx.query("CREATE TABLE streaming_test (a int)")

	var placeHolder = tx.url.match(/postgres/) ? '($1)' : '(?)';
	var vals = []
	for (var i = 0; i < 10; i++) {
		tx.query('INSERT INTO streaming_test (a) VALUES ' + placeHolder, [i])
		vals.push(i)
	}

	var i = 0;
	tx.query('SELECT a FROM streaming_test')
		.on('row', function (row) { test.equal(row.a, vals.shift()) })
		.on('end', function (result) {
			test.deepEqual(vals, [])
			tx.query('DROP TABLE streaming_test', function (err) {
				if (err) test.emit('error', err)
				else test.end()
			})
		})
})<commit_msg>fix streaming test idempotence<commit_after>require('./helpers').allTransactions("Streaming results", function (tx, test) {
  test.plan(11)

  tx.query("DROP TABLE IF EXISTS streaming_test", function (err) { /* swallow errors */ })
	tx.query("CREATE TABLE streaming_test (a int)")

	var placeHolder = tx.url.match(/postgres/) ? '($1)' : '(?)';
	var vals = []
	for (var i = 0; i < 10; i++) {
		tx.query('INSERT INTO streaming_test (a) VALUES ' + placeHolder, [i])
		vals.push(i)
	}

	var i = 0;
	tx.query('SELECT a FROM streaming_test')
		.on('row', function (row) { test.equal(row.a, vals.shift()) })
		.on('end', function (result) {
			test.deepEqual(vals, [])
		})
})
{'fraction_non_alphanumeric': 0.20089955022488756, 'fraction_numerical': 0.008995502248875561, 'mean_word_length': 4.0, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2722392', 'n_tokens_mistral': 524, 'n_tokens_neox': 482, 'n_words': 118}