Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible cache issue with demo endpoint #2

Closed
rowanmanning opened this issue Feb 24, 2016 · 1 comment
Closed

Possible cache issue with demo endpoint #2

rowanmanning opened this issue Feb 24, 2016 · 1 comment
Labels
bug Something isn't working

Comments

@rowanmanning
Copy link
Member

[originally reported by @AlbertoElias]

OBT has a bug where it builds demos indentically when building multiple of them that share the same template. Build service shouldn't have this issue as it only compiles one demo at a time, but with o-header, it generates the core demo for the enhanced one.

@Limess
Copy link
Contributor

Limess commented Nov 8, 2017

Tried to reproduce this locally with o-header in integration tests and couldn't:

		it('should not cache demo templates for the same component when built concurrently', function() {
			const testModule = 'o-header';
			const request1 = new Promise((resolve, reject) => {
				request(this.app)
					.get(`/v2/demos/${testModule}/main`)
					.set('Connection', 'close')
					.end(function(err, res) {
						if (err) return reject(err);
						resolve(res.text);
					});
			});

			const request2 = new Promise((resolve, reject) => {
				request(this.app)
					.get(`/v2/demos/${testModule}/mega-menu`)
					.set('Connection', 'close')
					.end(function(err, res) {
						if (err) return reject(err);
						resolve(res.text);
					});
			});

			return Promise.all([request1, request2])
			.then(([response1, response2]) => {
					assert.notDeepEqual(response1, response2);
				});
		});

		it('should not cache demo templates for the same component when built in serial', function() {
			const testModule = 'o-header';
			const request1 = new Promise((resolve, reject) => {
				request(this.app)
					.get(`/v2/demos/${testModule}/main`)
					.set('Connection', 'close')
					.end(function(err, res) {
						if (err) return reject(err);
						resolve(res.text);
					});
			});

			const request2 = new Promise((resolve, reject) => {
				request(this.app)
					.get(`/v2/demos/${testModule}/mega-menu`)
					.set('Connection', 'close')
					.end(function(err, res) {
						if (err) return reject(err);
						resolve(res.text);
					});
			});

			return request1.then((response1) => {
				return request2
					.then((response2) => {
						assert.notDeepEqual(response1, response2);
					});
			});
		});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants